Index
S
samDesired parameter, 418
Save As dialog boxes, 315
saving band layout, 243–245
saving Smartphone data, 956–957
saving text messages, 965
SB_BUTTON, 145
SB_CTL, 146
SB_ENDSCROLL, 145
SB_HORZ, 146
SB_LINExxx codes, 144
SB_PAGEDOWN, 204
SB_PAGEUP, 204
SB_PAGExxx codes, 144
SB_SETPOSITION, 143
SB_THUMBPOSITION, 143
SB_THUMBTRACK, 143
SB_TOP, 145
SB_VERT, 146
scan code translations, 99
SCHEDULECONNECTIONINFO structure, 963
scheduled connections, 961, 963
scheduled notifications, 580–581
scheduling system resuming, 1039
scheduling threads, 499–502
SCHMBM_GETSUBMENU, 944
SCHMBM_OVERRIDEKEY, 945, 947
screens. See also drawing
overview, 4
power management, 1036–1038
stylus, 109
user feedback, 110
writing storage, 110–116
scripts, resource, 182–183
scroll bar controls, 143–147
scroll codes, 144–145
Scroll Lock key, 95, 97
ScrollDC function, 108
SCROLLINFO structure, 146–147
scrolling buttons, 824
scrolling dialogs, 950
scrolling text, 108
SD_BOTH, 645
sDLLPath field, 877
SDP (Service Discovery Protocol), 680, 682–685
SdpQueryUuid structure, 678
SDP_SERVICE_ATTRIBUTE_REQUEST, 678
SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST, 678
SDP_SERVICE_SEARCH_REQUEST, 678
SD_RECEIVE, 645
SD_SEND, 645
searching database records, 449–452
searching device drivers, 1050–1052
searching directories, 410–413
SearchThread function, 713
securityfile system, 385
overview, 525–527
Smartphone, 929, 995–996
Seek function, 1059, 1091
seek pointers, call log, 959
seeking database records, 449–452
SEE_MASK_FLAG_NO_UI, 807
SEE_MASK_NOCLOSEPROCESS, 807
select function, 649
Select key, 94
Select method, 898–899, 928
SelectObject function, 55, 57, 66, 72
semaphore objects, 518–520
semicolon key, 95
send function, 640, 644
SendAlternatives2 method, 905
SendCharEvent method, 928
SendCharEvents method, 904
SendDlgItemMessage function, 137
SenderThread procedure, 545
SendEvent function, 547
SendFile function, 669
sending data, sockets, 644
sending IOCTL commands to services, 1088
sending SMS messages, 966–969
SendMessage function, 137, 184, 208
SendMessage method, 1135
SendSmsMessage routine, 994
SendString method, 905
sendto function, 644
SendVirtualKey method, 903
separate heaps, 364, 373–375, 380
separator key, 95
sequence, keyboard messages, 100
serial communicationasynchronous I/0, 588–589
errors, 597
examples, 598–613
overview, 585–586
portsclosing, 586
configuring, 589–592
controlling, 595–596
opening, 586
overview, 585
querying capabilities, 594–595
reading from, 587
timeout values, 592–593
writing to, 587
power management, 598
status, 597
serial links, 795
serial numbers, volume, 395
serial ports, Bluetooth communication, 687–692
SD_RECEIVE, 645
SD_SEND, 645
ServerThread function, 713
service discovery, Bluetooth, 677–681
Service Discovery Protocol (SDP), 680, 682–685
service publications, Bluetooth, 682–685
ServiceAddPort function, 1095–1096
serviceClassId field, 642
ServiceClosePort function, 1096
ServiceEnumInfo structure, 1089
serviceHandle parameter, 678
SERVICE_INIT_STANDALONE, 1090
SERVICE_INIT_STARTED, 1090
SERVICE_INIT_STOPPED, 1090
ServiceIoControl function, 1087–1088
servicesapplication controls, 1087–1089
architecture, 1085
command-line interface, 1098
console, 1093
currently running, 1088
custom commands, 1093
described, 1045
entry points, 1089–1091
examples, 1098–1112
IOCTL commands, 1091–1094
life cycle, 1085–1087
loading, 1087
options supported, 1094
overview, 1084
refreshing, 1091
removing registry entries, 1092
starting, 1087, 1091–1092
state, 1092
stopping, 1087, 1091
super service, 1094–1098
unloading, 1087, 1089, 1092
zone bitmaps, 1093
Services ManagerInit function, 1090
overview, 1084
service architecture, 1085
service life cycle, 1086
standalone, 1094
ServicesExeCallbackFunctions structure, 1094
ServiceUnbindPorts function, 1096
SetBkMode function, 879
SETBREAK, 596
SetBrushOrgEx function, 78
SetCapture function, 116
SetCommBreak function, 595–596
SetCommMask function, 588
SetCommState function, 589
SetCommTimeouts function, 592
SetCursor function, 110
SetDevicePower function, 1068
SetDIBColorTable function, 71
SETDTR, 596
SetEndOfFile function, 392
SetEvent function, 513
SetEventData function, 513
SetFileAttributes function, 393
SetFilePointer function, 391, 1059
SetFileTime function, 394
SetFocus function, 92
SetForegroundWindow function, 34, 528, 844
SetImData method, 900
SetImInfo method, 903, 928
SetIMMActiveContext method, 902
SetInterruptEvent function, 1060
SETIR, 596
SetLastError field, 1141
SetPassword method, 722
SetPath method, 721
SETPOWERMANAGEMENT, 1037
SetPowerRequirement function, 1043
SetProcPermissions function, 1080
SetRapiStat method, 767
SETRTS, 596
SetScrollInfo function, 145–147
setsockopt function, 648
SetStudioPathW function, 823
SetSystemPowerState function, 1042
SetTextAlign function, 45
SetTextColor function, 44
SetThreadPriority function, 504
Settings key, 416
SetupComm function, 593
SetWindowLong function, 132, 134–135, 314
SetWindowPos function, 133–134
SETXOFF, 596
SETXON, 596
SHACTIVATEINFO structure, 846
SHAddToRecentDocs function, 806
SHA_INPUT DIALOG, 847
shapesbrushes, 77–78
circles, 79
ellipses, 79
examples, 82–89
fill functions, 80–82
overview, 77
polygons, 80
rectangles, 78–80
SHARD_PATH, 806
SHARD_PIDL, 806
shared mode, New menu, 849
ShareMode parameter, 1057
sharpening fonts, 54
SHCMBF_COLORBK, 263, 941
SHCMBF_EMPTYBAR, 263, 844
SHCMBF_HIDDEN, 263
SHCMBF_HIDESIPBUTTON, 263
SHCMBF_HMENU, 263
SHCMBM_GETMENU, 269, 944
SHCMBM_GETSUBMENU, 269
SHCMBM_SETSUBMENU, 269
SHCreateMenuBar function, 262, 265, 492, 844, 932, 940
SHCreateShortcut function, 804, 805
SHCreateShortcutEx function, 804
sheets. See property sheets
shell management RAPI functions, 757
ShellExecuteEx function, 806
SHELLEXECUTEINFO structure, 806
Shell_NotifyIcon function, 808–809
shells. See also Pocket PC shell
application launching, 806–807, 824–830
memory management, 817
namespace, 800
overview, 799–800
recent documents list, 805
shortcuts, 804
special folders, 801–803
Start menu, 805
taskbars, 808–816
SHFS_HIDESIPBUTTON, 871
SHFS_HIDESTARTICON, 871
SHFS_HIDETASKBAR, 871
SHFS_SHOWSIPBUTTON, 871
SHFS_SHOWSTARTICON, 871
SHFS_SHOWTASKBAR, 871
SHFullScreen function, 871
SHGetAppKeyAssoc function, 827
SHGetAutoRunPath function, 870
SHGetFromIDList function, 802
SHGetMalloc function, 802
SHGetShortcutTarget function, 804
SHGetSpecialFolderLocation function, 802, 805
SHGetSpecialFolderPath function, 801, 805, 956
SHHandleWMActivate function, 847, 867
SHHandleWMSettingChange function, 846
SHIDIF_DIPDOWN, 865
SHIDIF_DONEBUTTON, 865
SHIDIF_FULLSCREENNOMENUBAR, 866
SHIDIF_SIZEDLG, 865
SHIDIF_SIZEDLGFULLSCREEN, 866
SHIDIM_FLAGS, 865
Shift key, 94, 98, 109
SHInitDialog function, 865, 867, 880, 949
SHINITDLGINFO structure, 865
SHInitExtraControls function, 867
SHInputDialog function, 867
SHLoadDIBitmap function, 68, 184
SHMBOF_NODEFAULT, 946
SHMBOF_NOTIFY, 946
SHMENUBARINFO structure, 262, 264–265, 268, 844, 940
SHNF_CRITICAL, 861
SHNF_DISPLAYON, 861
SHNF_FORCEMESSAGE, 861
SHNN_LINKSEL, 863
SHNotificationAdd function, 860
SHNOTIFICATIONDATA structure, 860, 863
SHNotificationGetData function, 863
SHNotificationRemove function, 864
SHNotificationUpdate function, 863
SHNP_ICONIC, 861
SHNP_INFORM, 861
SHNUM_DURATION, 863
SHNUM_HTML, 864
SHNUM_ICON, 864
SHNUM_PRIORITY, 863
SHNUM_TITLE, 864
Short Message Service (SMS)accessing, 966
configuring, 972–973
examples, 974–995
overview, 965
receiving messages, 969–971
saving messages, 965
sending messages, 966–969
service center numbers, 972
shortcuts, 185–186, 804, 824–830
Showing method, 900
ShowWindow function, 9
ShowWindow statement, 23
SHRecognizeGesture function, 118
SHRGINFO structure, 118
SHRG_LONGDELAY, 118
SHRG_NOTIFYPARENT, 118
SHRG_RETURNCMD, 118
SHSendBackToFocusWindow function, 947
SHSetAppKeyWndAssoc function, 828
SHShowOutOfMemory function, 817
SHSipInfo function, 845, 872, 874, 901, 1030
SHSipPreference function, 866, 872, 1030
shutdown function, 644
SHx, 3
SIF_DISABLENOSCROLL, 146
SIF_POS, 146
SIF_RANGE, 146
SIF_TRACKPOS, 147
signaled states, event, 512
simulatingkeystrokes, 99
Off button, user pressing, 1036
right mouse clicks, 118
soft keyboards, 91
sin_family field, 641
single instance, Pocket PC, 834, 843
single lines, text, 43
SIP (soft input panel)button, 261
.NET Compact Framework, 1136–1137
Pocket PC, 834, 846–847, 866–867, 871–874
SIP Control Panel applet, 901
SIP_DOWN, 866
SIPF_DISABLECOMPLETION, 899
SIPF_DOCKED, 873, 899, 903, 928
SIPF_LOCKED, 873, 899
SIPF_ON, 873, 899
SIP_FORCEDOWN, 866
SIPINFO structure, 872, 900–901
SIP_UNCHANGED, 866
SIP_UP, 866
sizedialog boxes, 298–302
drives, 414
file searches, 411
filenames, 386
files, 392, 394–395
fonts, 53
group boxes, 138
heap memory, 372, 374
icons, 184
input method, 899, 903
input panel, 900
object store, 387, 415
pages, 359
scroll bars, 146
separate heap, 374
shapes, 77–89
SIP, 1136
stack, 375
static data areas, 377–379
text messages, 970
Today screen items, 879
top-level forms, 1133
windows, 23, 26, 37, 845
Size property, 1136
Skip method, 717
skipping enumeration devices, 717
slash mark key, 95
Sleep function, 507, 1036
slots, address space, 1026
Smartphoneapplications, 932–939
buttons, 930, 944–947
communication features, 958
connection manager, 961–965
controls, 950–956
dialing, 958
dialog boxes, 949–950
file operation, 956–957
logs, 959–961
MenuBar control, 939–947
message boxes, 944, 947–948
multiple instances of, 939
overview, 833, 929–930
phone API, 958–961
restricted functions, 995
security, 995–996
user interface, 930–931
SM_MODE_RECEIVE, 966
SMS (Short Message Service)accessing, 966
configuring, 972–973
examples, 974–995
overview, 965
receiving messages, 969–971
saving messages, 965
sending messages, 966–969
service center numbers, 972
SMS_ADDRESS structure, 967–968, 970, 972
SMSAT_INTERNATIONAL, 968
SmsClearMessageNotification function, 973
SmsClose function, 966, 968
smsdeDataEncoding parameter, 967
SMSDE_GSM, 967
SMSDE_OPTIMAL, 967
SMSDE_UCS2, 967
SmsGetMessageSize function, 970
SmsGetMessageStatus function, 967
SmsGetPhoneNumber function, 972
SmsGetSMSC function, 972
SmsGetTime function, 973
SMS_HANDLE, 966
SMS_MODE_SEND, 966, 969
SMS_MSGTYPE_TEXT, 966, 973
SmsOpen function, 966, 968, 995
SMS_OPTION_DELIVERY_NONE, 967
SMS_OPTION_DELIVERY_NO_RETRY, 967
SmsQueryMessageStatus function, 972
SmsReadMessage function, 969–971
SMSREGISTRATIONDATA structure, 973
SmsSendMessage function, 966–969, 972
SmsSetMessageNotification function, 973
SmsSetSMSC function, 972
SMS_STATUS_INFORMATION structure, 972
SO_BTH_GET_MODE, 672
sockaddr, 642
SOCKADDR structure, 1094, 1096
SOCKADDR_BTH structure, 642–643, 675
SOCKADDR_IN structure, 641, 643
SOCKADDR_IRDA structure, 642–643
SOCK_DGRAM, 641
Socket class, 1137
socket function, 640–641
socket stream, 1137
SOCKET_ADDRESS, 675
SOCKET_ERROR, 675
sockets. See also stream sockets; super service
connectivity, 795
IrSockblocking vs. nonblocking, 648–651
examples, 651–670
options, 647–648
overview, 645–647
nonblocking mode, 638
overview, 637
SOCK_STREAM, 641
soft input panel (SIP). See SIP (soft input panel)
soft keyboards, 91
SoftKeyBar control, 941, 949
Software key, 416
SO_LINGER, 648
SOL_IRLMP, 645
SOMAXCONN, 643
sort orders, database, 452
SORTORDERSPECEX structure, 445, 447
spacecode fragments, 35
freeing memory, 368, 372, 374, 871
overview, 4
between text letters, 46
Spacebar, 94
SPACEPARITY, 591
special folders, 801–803
specifying registry keys, 415
SPI_GETBATTERYIDLETIMEOUT, 1039
SPI_GETCURRENTIM, 872, 874
SPI_GETEXTERNALIDLETIMEOUT, 1039
SPI_GETPLATFORMTYPE, 1032
SPI_GETSIPINFO, 872, 901
SPI_GETWAKEUPIDLETIMEOUT, 1039
spinner controls, Smartphone, 954–956
SPI_SETCURRENTIM, 872
SPI_SETSIPINFO, 872, 901
sprintf-style function, 1124
SP_SERIALCOMM, 595
SQL_IRLMP, 648
SQL_SOCKET, 648
square boxes, 138
SRCCOPY, 72
SrchDirectory function, 773
SRCINVERT, 72
SRCPAINT, 72
SS_BITMAP, 142
SS_CENTER, 142
SS_CENTERIMAGE, 143
SS_ICON, 142
SS_LEFT, 142
SS_LEFTNOWORDWRAP, 142
SS_NOPREFIX, 143
SS_NOTIFY, 143
SS_RIGHT, 142
stack, 364, 375–376, 380, 637, 671
stack frames, 25
STACK_SIZE_PARAM_IS_A_RESERVATION, 503
stand-alone control scroll bar, 146
standalone Services Manager, 1085, 1094
standard dialog boxes, 314
Start icon, 871
Start menu, 805, 833
StartDeviceEnum method, 716–717
starting games, 1001
starting services, 1087, 1091–1092
starting super service, 1094
State field, 369
StateFlags parameter, 1042
stateskey, 97–98, 109, 117
querying service, 1092
virtual page, 360
static controls, 142
static data, 363–364, 376–379, 380
static keyword, 1117
status bar control, 206, 295
status informationchecked/unchecked buttons, 215
connections, 964–965
exceptions, 555
keyboards, 100
memory state, 360–362, 381–384
modem control signals, 597
short text messages, 967, 972
system power state, 1033–1035
stDischargeTime field, 972
stEndTime field, 559
STILL_ACTIVE, 497, 504
stock brushes, 77
stock pens, 75
StopBits field, 591
StopDeviceEnum method, 716
StopDeviceNotifications function, 1067
stopping file searches, 411
stopping services, 1087, 1091
Storage Card directories, 386
storage cards, 869
storage volumes, opening, 390
STORE_INFORMATION structure, 415
storing content data. See resources
storing files. See file system
stream device driversdescribed, 1046
entry pointsoverview, 1055
xxx_Close, 1058
xxx_Deinit, 1057
xxx_Init, 1056
xxx_IOControl, 1060–1065
xxx_Open, 1057
xxx_PowerDown, 1059
xxx_PowerUp, 1060
xxx_Read, 1058
xxx_Seek, 1059
xxx_Write, 1059
names, 1046
overview, 1054–1055
services and, 1085
stream mode, 762, 767
stream socketsclient side, 643
closing, 644
connection acceptance, 643
connection process, 640
creating, 641
data transfers, 644
listen mode, 642
overview, 639–640
server side, 641–642
StretchBlt function, 72–73
string resources, 186
StringBuilder class, 1124, 1146
stringscommon language runtime, 1123–1125
length, 5
memory allocation, 379
Platform Invoke, 1145–1146
structures, Platform Invoke, 1143
stServiceCenterTimeStamp field, 972
stStartTime field, 559
style flags, 13–14, 22, 133–134
styles, dialog box, 300
stylusexamples, 118–127
inking, 110–116
input focus, 116–117
messages, 110, 116–117
overview, 110
right-button clicks, 117–118
tap, 93
window changes, 116–117
subclassing windows, 134–135
subfolders, 805
subkeys, 417, 881
submenus, 179, 260, 269, 805
super servicecontrolling programmatically, 1096
examples, 1098–1112
IOCTL commands, 1097–1098
loading, 1095
overview, 1094–1096
starting, 1094
suspend counts, 506
suspendingdevice enumeration, 714
GAPI applications, 1003
system power, 1036
threads, 506
SuspendThread function, 506
switch statement, 25, 28
switching property pages, 314
SwitchToFiber function, 508
SWP_DRAWFRAME, 134
SWP_FRAMECHANGED, 134
SWP_HIDEWINDOW, 134
SWP_NOACTIVATE, 134
SWP_NOMOVE, 134
SWP_NOSIZE, 134
SWP_NOZORDER, 134
SWP_SHOWWINDOW, 134
Sync service, 719
synchronizationcritical sections, 521–523
duplicate handles, 521
event objects, 512–514
interlocked variable access, 523–525
memory-mapped objects, 529
mutexes, 520–521
overview, 511
semaphore objects, 518–520
waiting, 514–518
synchronous connections, 961, 963
synchronous device detections, 716, 718
synchronous I/O, 588
system event notificationsexamples, 566–579
overview, 564–566
system heap, 358
system information RAPI functions, 752
System.Console.WriteLine, 1118
SystemIdleTimerReset function, 1039
SystemParametersInfo function, 1039
SystemPowerState field, 1041
SYSTEM_POWER_STATUS_EX2 structure, 1034
systems programming. See also memory management; power management
memory architecture, 1025–1027
overview, 1025
SYSTEMTIME structure, 288, 394, 967, 970
systemwide unique identifiers, 395
szAppName field, 33, 964
szCmdLine field, 964
szCmdLine parameter, 496
szDbaseName field, 444
szDescription field, 639
szDllName field, 1088
szName field, 877
szPrefix field, 1089
szPrefix parameter, 1088
szRegWritePath parameter, 1096
szShortcut parameter, 804
szSystemStatus field, 639
szTip field, 809
szToken field, 963, 964