Top Description Fields Methods
com.sun.jna.platform.win32

public Interface User32

extends StdCallLibrary, WinUser, WinNT
Imports
com.sun.jna.Native, .Pointer, .Structure, com.sun.jna.platform.win32.WinGDI.ICONINFO, com.sun.jna.ptr.ByteByReference, .IntByReference, com.sun.jna.win32.StdCallLibrary, .W32APIOptions

Provides access to the w32 user32 library. Incomplete implementation to support demos.
Authors
Todd Fast, [email protected], [email protected], Tobias Wolf, [email protected], Markus KARG (markus[at]headcrashing[dot]eu), Andreas "PAX" Lück, onkelpax-git[at]yahoo.de

Field Summary

Modifier and TypeField and Description
public static final int
CS_GLOBALCLASS

The cs globalclass.

public static final int
DEVICE_NOTIFY_ALL_INTERFACE_CLASSES

The device notify all interface classes.

public static final int
DEVICE_NOTIFY_SERVICE_HANDLE

The hRecipient parameter is a service status handle.

public static final int
DEVICE_NOTIFY_WINDOW_HANDLE

The hRecipient parameter is a window handle.

public static final WinDef.HWND
HWND_MESSAGE

Hides com.sun.jna.platform.win32.WinUser.HWND_MESSAGE.

Handle for message-only window.
public static final User32
INSTANCE

The instance.

public static final int
SW_SHOWDEFAULT

Hides com.sun.jna.platform.win32.WinUser.SW_SHOWDEFAULT.

Sets the show state based on the SW_ value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.

public static final int
WS_EX_TOPMOST

The ws ex topmost.

Inherited from com.sun.jna.platform.win32.WinNT:
ACCESS_ALLOWED_ACE_TYPEACCESS_ALLOWED_CALLBACK_ACE_TYPEACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPEACCESS_ALLOWED_COMPOUND_ACE_TYPEACCESS_ALLOWED_OBJECT_ACE_TYPEACCESS_DENIED_ACE_TYPEACCESS_DENIED_CALLBACK_ACE_TYPEACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPEACCESS_DENIED_OBJECT_ACE_TYPEACCESS_SYSTEM_SECURITYACL_REVISIONACL_REVISION1ACL_REVISION2ACL_REVISION3ACL_REVISION4ACL_REVISION_DSBOOLEAN_FALSEBOOLEAN_TRUECACHE_FULLY_ASSOCIATIVECOMPRESSION_ENGINE_HIBERCOMPRESSION_ENGINE_MAXIMUMCOMPRESSION_ENGINE_STANDARDCOMPRESSION_FORMAT_DEFAULTCOMPRESSION_FORMAT_LZNT1COMPRESSION_FORMAT_NONECOMPRESSION_FORMAT_XPRESSCOMPRESSION_FORMAT_XPRESS_HUFFCONTAINER_INHERIT_ACECREATE_ALWAYSCREATE_NEWDACL_SECURITY_INFORMATIONDDD_EXACT_MATCH_ON_REMOVEDDD_NO_BROADCAST_SYSTEMDDD_RAW_TARGET_PATHDDD_REMOVE_DEFINITIONDELETEEVENT_ALL_ACCESSEVENT_MODIFY_STATEEVENTLOG_AUDIT_FAILUREEVENTLOG_AUDIT_SUCCESSEVENTLOG_BACKWARDS_READEVENTLOG_ERROR_TYPEEVENTLOG_FORWARDS_READEVENTLOG_INFORMATION_TYPEEVENTLOG_SEEK_READEVENTLOG_SEQUENTIAL_READEVENTLOG_SUCCESSEVENTLOG_WARNING_TYPEFILE_ACTION_ADDEDFILE_ACTION_MODIFIEDFILE_ACTION_REMOVEDFILE_ACTION_RENAMED_NEW_NAMEFILE_ACTION_RENAMED_OLD_NAMEFILE_ADD_FILEFILE_ADD_SUBDIRECTORYFILE_ALL_ACCESSFILE_APPEND_DATAFILE_ATTRIBUTE_ARCHIVEFILE_ATTRIBUTE_COMPRESSEDFILE_ATTRIBUTE_DEVICEFILE_ATTRIBUTE_DIRECTORYFILE_ATTRIBUTE_ENCRYPTEDFILE_ATTRIBUTE_HIDDENFILE_ATTRIBUTE_NORMALFILE_ATTRIBUTE_NOT_CONTENT_INDEXEDFILE_ATTRIBUTE_OFFLINEFILE_ATTRIBUTE_READONLYFILE_ATTRIBUTE_REPARSE_POINTFILE_ATTRIBUTE_SPARSE_FILEFILE_ATTRIBUTE_SYSTEMFILE_ATTRIBUTE_TEMPORARYFILE_ATTRIBUTE_VIRTUALFILE_CASE_PRESERVED_NAMESFILE_CASE_SENSITIVE_SEARCHFILE_CREATE_PIPE_INSTANCEFILE_DELETE_CHILDFILE_EXECUTEFILE_FILE_COMPRESSIONFILE_FLAG_BACKUP_SEMANTICSFILE_FLAG_DELETE_ON_CLOSEFILE_FLAG_NO_BUFFERINGFILE_FLAG_OPEN_NO_RECALLFILE_FLAG_OPEN_REPARSE_POINTFILE_FLAG_OVERLAPPEDFILE_FLAG_POSIX_SEMANTICSFILE_FLAG_RANDOM_ACCESSFILE_FLAG_SEQUENTIAL_SCANFILE_FLAG_WRITE_THROUGHFILE_GENERIC_EXECUTEFILE_GENERIC_READFILE_GENERIC_WRITEFILE_LIST_DIRECTORYFILE_NAMED_STREAMSFILE_NOTIFY_CHANGE_ATTRIBUTESFILE_NOTIFY_CHANGE_CREATIONFILE_NOTIFY_CHANGE_DIR_NAMEFILE_NOTIFY_CHANGE_FILE_NAMEFILE_NOTIFY_CHANGE_LAST_ACCESSFILE_NOTIFY_CHANGE_LAST_WRITEFILE_NOTIFY_CHANGE_NAMEFILE_NOTIFY_CHANGE_SECURITYFILE_NOTIFY_CHANGE_SIZEFILE_PERSISTENT_ACLSFILE_READ_ATTRIBUTESFILE_READ_DATAFILE_READ_EAFILE_READ_ONLY_VOLUMEFILE_SEQUENTIAL_WRITE_ONCEFILE_SHARE_DELETEFILE_SHARE_READFILE_SHARE_WRITEFILE_SUPPORTS_ENCRYPTIONFILE_SUPPORTS_EXTENDED_ATTRIBUTESFILE_SUPPORTS_HARD_LINKSFILE_SUPPORTS_OBJECT_IDSFILE_SUPPORTS_OPEN_BY_FILE_IDFILE_SUPPORTS_REMOTE_STORAGEFILE_SUPPORTS_REPARSE_POINTSFILE_SUPPORTS_SPARSE_FILESFILE_SUPPORTS_TRANSACTIONSFILE_SUPPORTS_USN_JOURNALFILE_TRAVERSEFILE_TYPE_CHARFILE_TYPE_DISKFILE_TYPE_PIPEFILE_TYPE_REMOTEFILE_TYPE_UNKNOWNFILE_UNICODE_ON_DISKFILE_VOLUME_IS_COMPRESSEDFILE_VOLUME_QUOTASFILE_WRITE_ATTRIBUTESFILE_WRITE_DATAFILE_WRITE_EAGENERIC_ALLGENERIC_EXECUTEGENERIC_READGENERIC_WRITEGROUP_SECURITY_INFORMATIONINHERIT_ONLY_ACEINHERITED_ACEIO_REPARSE_TAG_CSVIO_REPARSE_TAG_DFSIO_REPARSE_TAG_DFSRIO_REPARSE_TAG_HSMIO_REPARSE_TAG_HSM2IO_REPARSE_TAG_MOUNT_POINTIO_REPARSE_TAG_SISIO_REPARSE_TAG_SYMLINKIO_REPARSE_TAG_WIMKEY_ALL_ACCESSKEY_CREATE_LINKKEY_CREATE_SUB_KEYKEY_ENUMERATE_SUB_KEYSKEY_EXECUTEKEY_NOTIFYKEY_QUERY_VALUEKEY_READKEY_SET_VALUEKEY_WOW64_32KEYKEY_WOW64_64KEYKEY_WOW64_RESKEY_WRITELABEL_SECURITY_INFORMATIONLANG_AFRIKAANSLANG_ALBANIANLANG_ARABICLANG_ARMENIANLANG_ASSAMESELANG_AZERILANG_BASQUELANG_BELARUSIANLANG_BENGALILANG_BULGARIANLANG_CATALANLANG_CHINESELANG_CROATIANLANG_CZECHLANG_DANISHLANG_DIVEHILANG_DUTCHLANG_ENGLISHLANG_ESTONIANLANG_FAEROESELANG_FARSILANG_FINNISHLANG_FRENCHLANG_GALICIANLANG_GEORGIANLANG_GERMANLANG_GREEKLANG_GUJARATILANG_HEBREWLANG_HINDILANG_HUNGARIANLANG_ICELANDICLANG_INDONESIANLANG_INVARIANTLANG_ITALIANLANG_JAPANESELANG_KANNADALANG_KASHMIRILANG_KAZAKLANG_KONKANILANG_KOREANLANG_KYRGYZLANG_LATVIANLANG_LITHUANIANLANG_MACEDONIANLANG_MALAYLANG_MALAYALAMLANG_MANIPURILANG_MARATHILANG_MONGOLIANLANG_NEPALILANG_NEUTRALLANG_NORWEGIANLANG_ORIYALANG_POLISHLANG_PORTUGUESELANG_PUNJABILANG_ROMANIANLANG_RUSSIANLANG_SANSKRITLANG_SERBIANLANG_SINDHILANG_SLOVAKLANG_SLOVENIANLANG_SPANISHLANG_SWAHILILANG_SWEDISHLANG_SYRIACLANG_SYSTEM_DEFAULTLANG_TAMILLANG_TATARLANG_TELUGULANG_THAILANG_TURKISHLANG_UKRAINIANLANG_URDULANG_USER_DEFAULTLANG_UZBEKLANG_VIETNAMESELOCALE_INVARIANTLOCALE_NEUTRALLOCALE_SYSTEM_DEFAULTLOCALE_USER_DEFAULTLTP_PC_SMTMAX_ACL_REVISIONMAXBYTEMAXCHARMAXDWORDMAXLONGMAXSHORTMAXWORDMEM_COALESCE_PLACEHOLDERSMEM_COMMITMEM_DECOMMITMEM_FREEMEM_IMAGEMEM_LARGE_PAGESMEM_MAPPEDMEM_PHYSICALMEM_PRESERVE_PLACEHOLDERMEM_PRIVATEMEM_RELEASEMEM_RESERVEMEM_RESETMEM_RESET_UNDOMEM_TOP_DOWNMIN_ACL_REVISIONMINCHARMINLONGMINSHORTMUTANT_ALL_ACCESSMUTANT_QUERY_STATENLS_VALID_LOCALE_MASKNO_PROPAGATE_INHERIT_ACENUM_DISCHARGE_POLICIESOBJECT_INHERIT_ACEOPEN_ALWAYSOPEN_EXISTINGOWNER_SECURITY_INFORMATIONPAGE_EXECUTEPAGE_EXECUTE_READPAGE_EXECUTE_READWRITEPAGE_GUARDPAGE_NOACCESSPAGE_READONLYPAGE_READWRITEPAGE_WRITECOPYPROCESS_ALL_ACCESSPROCESS_CREATE_PROCESSPROCESS_CREATE_THREADPROCESS_DUP_HANDLEPROCESS_NAME_NATIVEPROCESS_QUERY_INFORMATIONPROCESS_QUERY_LIMITED_INFORMATIONPROCESS_SET_INFORMATIONPROCESS_SET_QUOTAPROCESS_SUSPEND_RESUMEPROCESS_SYNCHRONIZEPROCESS_TERMINATEPROCESS_VM_OPERATIONPROCESS_VM_READPROCESS_VM_WRITEPROTECTED_DACL_SECURITY_INFORMATIONPROTECTED_SACL_SECURITY_INFORMATIONREAD_CONTROLREG_APP_HIVEREG_BINARYREG_CREATED_NEW_KEYREG_DWORDREG_DWORD_BIG_ENDIANREG_DWORD_LITTLE_ENDIANREG_EXPAND_SZREG_FORCE_RESTOREREG_FORCE_UNLOADREG_FULL_RESOURCE_DESCRIPTORREG_HIVE_EXACT_FILE_GROWTHREG_HIVE_NO_RMREG_HIVE_SINGLE_LOGREG_LATEST_FORMATREG_LEGAL_CHANGE_FILTERREG_LEGAL_OPTIONREG_LINKREG_MULTI_SZREG_NO_COMPRESSIONREG_NO_LAZY_FLUSHREG_NONEREG_NOTIFY_CHANGE_ATTRIBUTESREG_NOTIFY_CHANGE_LAST_SETREG_NOTIFY_CHANGE_NAMEREG_NOTIFY_CHANGE_SECURITYREG_NOTIFY_THREAD_AGNOSTICREG_OPENED_EXISTING_KEYREG_OPTION_BACKUP_RESTOREREG_OPTION_CREATE_LINKREG_OPTION_NON_VOLATILEREG_OPTION_OPEN_LINKREG_OPTION_RESERVEDREG_OPTION_VOLATILEREG_PROCESS_PRIVATEREG_QWORDREG_QWORD_LITTLE_ENDIANREG_REFRESH_HIVEREG_RESOURCE_LISTREG_RESOURCE_REQUIREMENTS_LISTREG_STANDARD_FORMATREG_START_JOURNALREG_SZREG_WHOLE_HIVE_VOLATILESACL_SECURITY_INFORMATIONSE_ASSIGNPRIMARYTOKEN_NAMESE_AUDIT_NAMESE_BACKUP_NAMESE_CHANGE_NOTIFY_NAMESE_CREATE_GLOBAL_NAMESE_CREATE_PAGEFILE_NAMESE_CREATE_PERMANENT_NAMESE_CREATE_TOKEN_NAMESE_DACL_AUTO_INHERIT_REQSE_DACL_AUTO_INHERITEDSE_DACL_DEFAULTEDSE_DACL_PRESENTSE_DACL_PROTECTEDSE_DEBUG_NAMESE_ENABLE_DELEGATION_NAMESE_GROUP_DEFAULTEDSE_IMPERSONATE_NAMESE_INC_BASE_PRIORITY_NAMESE_INCREASE_QUOTA_NAMESE_LOAD_DRIVER_NAMESE_LOCK_MEMORY_NAMESE_MACHINE_ACCOUNT_NAMESE_MANAGE_VOLUME_NAMESE_OWNER_DEFAULTEDSE_PRIVILEGE_ENABLEDSE_PRIVILEGE_ENABLED_BY_DEFAULTSE_PRIVILEGE_REMOVEDSE_PRIVILEGE_USED_FOR_ACCESSSE_PROF_SINGLE_PROCESS_NAMESE_REMOTE_SHUTDOWN_NAMESE_RESTORE_NAMESE_RM_CONTROL_VALIDSE_SACL_AUTO_INHERIT_REQSE_SACL_AUTO_INHERITEDSE_SACL_DEFAULTEDSE_SACL_PRESENTSE_SACL_PROTECTEDSE_SECURITY_NAMESE_SELF_RELATIVESE_SHUTDOWN_NAMESE_SYNC_AGENT_NAMESE_SYSTEM_ENVIRONMENT_NAMESE_SYSTEM_PROFILE_NAMESE_SYSTEMTIME_NAMESE_TAKE_OWNERSHIP_NAMESE_TCB_NAMESE_UNDOCK_NAMESE_UNSOLICITED_INPUT_NAMESECTION_ALL_ACCESSSECTION_EXTEND_SIZESECTION_MAP_EXECUTESECTION_MAP_EXECUTE_EXPLICITSECTION_MAP_READSECTION_MAP_WRITESECTION_QUERYSECURITY_DESCRIPTOR_REVISIONSECURITY_DYNAMIC_TRACKINGSECURITY_MAX_SID_SIZESECURITY_STATIC_TRACKINGSERVICE_ADAPTERSERVICE_AUTO_STARTSERVICE_BOOT_STARTSERVICE_DEMAND_STARTSERVICE_DISABLEDSERVICE_DRIVERSERVICE_ERROR_CRITICALSERVICE_ERROR_IGNORESERVICE_ERROR_NORMALSERVICE_ERROR_SEVERESERVICE_FILE_SYSTEM_DRIVERSERVICE_INTERACTIVE_PROCESSSERVICE_KERNEL_DRIVERSERVICE_RECOGNIZER_DRIVERSERVICE_SYSTEM_STARTSERVICE_TYPE_ALLSERVICE_WIN32SERVICE_WIN32_OWN_PROCESSSERVICE_WIN32_SHARE_PROCESSSID_MAX_SUB_AUTHORITIESSID_RECOMMENDED_SUB_AUTHORITIESSID_REVISIONSORT_CHINESE_BIG5SORT_CHINESE_BOPOMOFOSORT_CHINESE_PRCSORT_CHINESE_PRCPSORT_CHINESE_UNICODESORT_DEFAULTSORT_GEORGIAN_MODERNSORT_GEORGIAN_TRADITIONALSORT_GERMAN_PHONE_BOOKSORT_HUNGARIAN_DEFAULTSORT_HUNGARIAN_TECHNICALSORT_JAPANESE_UNICODESORT_JAPANESE_XJISSORT_KOREAN_KSCSORT_KOREAN_UNICODESPECIFIC_RIGHTS_ALLSTANDARD_RIGHTS_ALLSTANDARD_RIGHTS_EXECUTESTANDARD_RIGHTS_READSTANDARD_RIGHTS_REQUIREDSTANDARD_RIGHTS_WRITESTATUS_PENDINGSUBLANG_ARABIC_ALGERIASUBLANG_ARABIC_BAHRAINSUBLANG_ARABIC_EGYPTSUBLANG_ARABIC_IRAQSUBLANG_ARABIC_JORDANSUBLANG_ARABIC_KUWAITSUBLANG_ARABIC_LEBANONSUBLANG_ARABIC_LIBYASUBLANG_ARABIC_MOROCCOSUBLANG_ARABIC_OMANSUBLANG_ARABIC_QATARSUBLANG_ARABIC_SAUDI_ARABIASUBLANG_ARABIC_SYRIASUBLANG_ARABIC_TUNISIASUBLANG_ARABIC_UAESUBLANG_ARABIC_YEMENSUBLANG_AZERI_CYRILLICSUBLANG_AZERI_LATINSUBLANG_CHINESE_HONGKONGSUBLANG_CHINESE_MACAUSUBLANG_CHINESE_SIMPLIFIEDSUBLANG_CHINESE_SINGAPORESUBLANG_CHINESE_TRADITIONALSUBLANG_DEFAULTSUBLANG_DUTCHSUBLANG_DUTCH_BELGIANSUBLANG_ENGLISH_AUSSUBLANG_ENGLISH_BELIZESUBLANG_ENGLISH_CANSUBLANG_ENGLISH_CARIBBEANSUBLANG_ENGLISH_EIRESUBLANG_ENGLISH_JAMAICASUBLANG_ENGLISH_NZSUBLANG_ENGLISH_PHILIPPINESSUBLANG_ENGLISH_SOUTH_AFRICASUBLANG_ENGLISH_TRINIDADSUBLANG_ENGLISH_UKSUBLANG_ENGLISH_USSUBLANG_ENGLISH_ZIMBABWESUBLANG_FRENCHSUBLANG_FRENCH_BELGIANSUBLANG_FRENCH_CANADIANSUBLANG_FRENCH_LUXEMBOURGSUBLANG_FRENCH_MONACOSUBLANG_FRENCH_SWISSSUBLANG_GERMANSUBLANG_GERMAN_AUSTRIANSUBLANG_GERMAN_LIECHTENSTEINSUBLANG_GERMAN_LUXEMBOURGSUBLANG_GERMAN_SWISSSUBLANG_ITALIANSUBLANG_ITALIAN_SWISSSUBLANG_KASHMIRI_INDIASUBLANG_KASHMIRI_SASIASUBLANG_KOREANSUBLANG_LITHUANIANSUBLANG_MALAY_BRUNEI_DARUSSALAMSUBLANG_MALAY_MALAYSIASUBLANG_NEPALI_INDIASUBLANG_NEUTRALSUBLANG_NORWEGIAN_BOKMALSUBLANG_NORWEGIAN_NYNORSKSUBLANG_PORTUGUESESUBLANG_PORTUGUESE_BRAZILIANSUBLANG_SERBIAN_CYRILLICSUBLANG_SERBIAN_LATINSUBLANG_SPANISHSUBLANG_SPANISH_ARGENTINASUBLANG_SPANISH_BOLIVIASUBLANG_SPANISH_CHILESUBLANG_SPANISH_COLOMBIASUBLANG_SPANISH_COSTA_RICASUBLANG_SPANISH_DOMINICAN_REPUBLICSUBLANG_SPANISH_ECUADORSUBLANG_SPANISH_EL_SALVADORSUBLANG_SPANISH_GUATEMALASUBLANG_SPANISH_HONDURASSUBLANG_SPANISH_MEXICANSUBLANG_SPANISH_MODERNSUBLANG_SPANISH_NICARAGUASUBLANG_SPANISH_PANAMASUBLANG_SPANISH_PARAGUAYSUBLANG_SPANISH_PERUSUBLANG_SPANISH_PUERTO_RICOSUBLANG_SPANISH_URUGUAYSUBLANG_SPANISH_VENEZUELASUBLANG_SWEDISHSUBLANG_SWEDISH_FINLANDSUBLANG_SYS_DEFAULTSUBLANG_URDU_INDIASUBLANG_URDU_PAKISTANSUBLANG_UZBEK_CYRILLICSUBLANG_UZBEK_LATINSYNCHRONIZESYSTEM_ALARM_ACE_TYPESYSTEM_ALARM_CALLBACK_ACE_TYPESYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPESYSTEM_ALARM_OBJECT_ACE_TYPESYSTEM_AUDIT_ACE_TYPESYSTEM_AUDIT_CALLBACK_ACE_TYPESYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPESYSTEM_AUDIT_OBJECT_ACE_TYPESYSTEM_MANDATORY_LABEL_ACE_TYPETHREAD_ALL_ACCESSTHREAD_DIRECT_IMPERSONATIONTHREAD_GET_CONTEXTTHREAD_IMPERSONATETHREAD_QUERY_INFORMATIONTHREAD_QUERY_LIMITED_INFORMATIONTHREAD_SET_CONTEXTTHREAD_SET_INFORMATIONTHREAD_SET_LIMITED_INFORMATIONTHREAD_SET_THREAD_TOKENTHREAD_SUSPEND_RESUMETHREAD_TERMINATETOKEN_ADJUST_DEFAULTTOKEN_ADJUST_GROUPSTOKEN_ADJUST_PRIVILEGESTOKEN_ADJUST_SESSIONIDTOKEN_ALL_ACCESSTOKEN_ALL_ACCESS_PTOKEN_ASSIGN_PRIMARYTOKEN_DUPLICATETOKEN_EXECUTETOKEN_IMPERSONATETOKEN_QUERYTOKEN_QUERY_SOURCETOKEN_READTOKEN_WRITETRUNCATE_EXISTINGUNPROTECTED_DACL_SECURITY_INFORMATIONUNPROTECTED_SACL_SECURITY_INFORMATIONVALID_INHERIT_FLAGSVER_ANDVER_BUILDNUMBERVER_CONDITION_MASKVER_EQUALVER_GREATERVER_GREATER_EQUALVER_LESSVER_LESS_EQUALVER_MAJORVERSIONVER_MINORVERSIONVER_NT_DOMAIN_CONTROLLERVER_NT_SERVERVER_NT_WORKSTATIONVER_NUM_BITS_PER_CONDITION_MASKVER_ORVER_PLATFORM_WIN32_NTVER_PLATFORM_WIN32_WINDOWSVER_PLATFORM_WIN32sVER_PLATFORMIDVER_PRODUCT_TYPEVER_SERVICEPACKMAJORVER_SERVICEPACKMINORVER_SUITENAMEWIN32_WINNT_LONGHORNWIN32_WINNT_NT4WIN32_WINNT_VISTAWIN32_WINNT_WIN10WIN32_WINNT_WIN2KWIN32_WINNT_WIN6WIN32_WINNT_WIN7WIN32_WINNT_WIN8WIN32_WINNT_WINBLUEWIN32_WINNT_WINTHRESHOLDWIN32_WINNT_WINXPWIN32_WINNT_WS03WIN32_WINNT_WS08WRITE_DACWRITE_OWNER
Inherited from com.sun.jna.platform.win32.WinUser:
AC_SRC_ALPHAAC_SRC_NO_ALPHAAC_SRC_NO_PREMULT_ALPHAAC_SRC_OVERBS_3STATEBS_AUTO3STATEBS_AUTOCHECKBOXBS_AUTORADIOBUTTONBS_CHECKBOXBS_DEFPUSHBUTTONBS_GROUPBOXBS_LEFTTEXTBS_OWNERDRAWBS_PUSHBOXBS_PUSHBUTTONBS_RADIOBUTTONBS_TYPEMASKBS_USERBUTTONCCHDEVICENAMECF_BITMATCF_DIBCF_DIBV5CF_DIFCF_DSPBITMAPCF_DSPENHMETAFILECF_DSPMETAFILEPICTCF_DSPTEXTCF_ENHMETAFILECF_GDIOBJFIRSTCF_GDIOBJLASTCF_HDROPCF_LOCALECF_METAFILEPICTCF_OEMTEXTCF_OWNERDISPLAYCF_PALETTECF_PENDATACF_PRIVATEFIRSTCF_PRIVATELASTCF_RIFFCF_SYLKCF_TEXTCF_TIFFCF_UNICODETEXTCF_WAVEDWL_DLGPROCDWL_MSGRESULTDWL_USEREWX_FORCEEWX_FORCEIFHUNGEWX_HYBRID_SHUTDOWNEWX_LOGOFFEWX_POWEROFFEWX_REBOOTEWX_RESTARTAPPSEWX_SHUTDOWNFLASHW_ALLFLASHW_CAPTIONFLASHW_STOPFLASHW_TIMERFLASHW_TIMERNOFGFLASHW_TRAYGA_PARENTGA_ROOTGA_ROOTOWNERGCL_CBCLSEXTRAGCL_CBWNDEXTRAGCL_HICONGCL_HICONSMGCL_STYLEGCLP_HBRBACKGROUNDGCLP_HCURSORGCLP_HICONGCLP_HICONSMGCLP_HMODULEGCLP_MENUNAMEGCLP_WNDPROCGCW_ATOMGW_CHILDGW_ENABLEDPOPUPGW_HWNDFIRSTGW_HWNDLASTGW_HWNDNEXTGW_HWNDPREVGW_OWNERGWL_EXSTYLEGWL_HINSTANCEGWL_HWNDPARENTGWL_IDGWL_STYLEGWL_USERDATAGWL_WNDPROCHWND_BROADCASTICON_BIGICON_SMALLICON_SMALL2IDC_APPSTARTINGIDC_ARROWIDC_CROSSIDC_HANDIDC_HELPIDC_IBEAMIDC_NOIDC_SIZEALLIDC_SIZENESWIDC_SIZENSIDC_SIZENWSEIDC_SIZEWEIDC_UPARROWIDC_WAITIDI_APPLICATIONIDI_ASTERISKIDI_EXCLAMATIONIDI_HANDIDI_QUESTIONIDI_WINLOGOIMAGE_BITMAPIMAGE_CURSORIMAGE_ENHMETAFILEIMAGE_ICONKL_NAMELENGTHLR_COLORLR_COPYDELETEORGLR_COPYFROMRESOURCELR_COPYRETURNORGLR_CREATEDIBSECTIONLR_DEFAULTCOLORLR_DEFAULTSIZELR_LOADFROMFILELR_LOADMAP3DCOLORSLR_LOADTRANSPARENTLR_MONOCHROMELR_SHAREDLR_VGACOLORLWA_ALPHALWA_COLORKEYMAPVK_VK_TO_CHARMAPVK_VK_TO_VSCMAPVK_VK_TO_VSC_EXMAPVK_VSC_TO_VKMAPVK_VSC_TO_VK_EXMOD_ALTMOD_CONTROLMOD_NOREPEATMOD_SHIFTMOD_WINMODIFIER_ALT_MASKMODIFIER_CTRL_MASKMODIFIER_HANKAKU_MASKMODIFIER_RESERVED1_MASKMODIFIER_RESERVED2_MASKMODIFIER_SHIFT_MASKMONITOR_DEFAULTTONEARESTMONITOR_DEFAULTTONULLMONITOR_DEFAULTTOPRIMARYMONITORINFOF_PRIMARYRDW_ALLCHILDRENRDW_ERASERDW_ERASENOWRDW_FRAMERDW_INTERNALPAINTRDW_INVALIDATERDW_NOCHILDRENRDW_NOERASERDW_NOFRAMERDW_NOINTERNALPAINTRDW_UPDATENOWRDW_VALIDATERIM_TYPEHIDRIM_TYPEKEYBOARDRIM_TYPEMOUSESC_MAXIMIZESC_MINIMIZESM_ARRANGESM_CARETBLINKINGENABLEDSM_CLEANBOOTSM_CMONITORSSM_CMOUSEBUTTONSSM_CXBORDERSM_CXCURSORSM_CXDLGFRAMESM_CXDOUBLECLKSM_CXDRAGSM_CXEDGESM_CXFIXEDFRAMESM_CXFOCUSBORDERSM_CXFRAMESM_CXFULLSCREENSM_CXHSCROLLSM_CXHTHUMBSM_CXICONSM_CXICONSPACINGSM_CXMAXIMIZEDSM_CXMAXTRACKSM_CXMENUCHECKSM_CXMENUSIZESM_CXMINSM_CXMINIMIZEDSM_CXMINSPACINGSM_CXMINTRACKSM_CXPADDEDBORDERSM_CXSCREENSM_CXSIZESM_CXSIZEFRAMESM_CXSMICONSM_CXSMSIZESM_CXVIRTUALSCREENSM_CXVSCROLLSM_CYBORDERSM_CYCAPTIONSM_CYCURSORSM_CYDLGFRAMESM_CYDOUBLECLKSM_CYDRAGSM_CYEDGESM_CYFIXEDFRAMESM_CYFOCUSBORDERSM_CYFRAMESM_CYFULLSCREENSM_CYHSCROLLSM_CYICONSM_CYICONSPACINGSM_CYKANJIWINDOWSM_CYMAXIMIZEDSM_CYMAXTRACKSM_CYMENUSM_CYMENUCHECKSM_CYMENUSIZESM_CYMINSM_CYMINIMIZEDSM_CYMINSPACINGSM_CYMINTRACKSM_CYSCREENSM_CYSIZESM_CYSIZEFRAMESM_CYSMCAPTIONSM_CYSMICONSM_CYSMSIZESM_CYVIRTUALSCREENSM_CYVSCROLLSM_CYVTHUMBSM_DBCSENABLEDSM_DEBUGSM_IMMENABLEDSM_MEDIACENTERSM_MENUDROPALIGNMENTSM_MIDEASTENABLEDSM_MOUSEHORIZONTALWHEELPRESENTSM_MOUSEPRESENTSM_MOUSEWHEELPRESENTSM_NETWORKSM_PENWINDOWSSM_REMOTECONTROLSM_REMOTESESSIONSM_RESERVED1SM_RESERVED2SM_RESERVED3SM_RESERVED4SM_SAMEDISPLAYFORMATSM_SECURESM_SERVERR2SM_SHOWSOUNDSSM_SHUTTINGDOWNSM_SLOWMACHINESM_STARTERSM_SWAPBUTTONSM_TABLETPCSM_XVIRTUALSCREENSM_YVIRTUALSCREENSMTO_ABORTIFHUNGSMTO_BLOCKSMTO_ERRORONEXITSMTO_NORMALSMTO_NOTIMEOUTIFNOTHUNGSW_FORCEMINIMIZESW_HIDESW_MAXSW_MAXIMIZESW_MINIMIZESW_NORMALSW_RESTORESW_SHOWSW_SHOWMAXIMIZEDSW_SHOWMINIMIZEDSW_SHOWMINNOACTIVESW_SHOWNASW_SHOWNOACTIVATESW_SHOWNORMALSWP_ASYNCWINDOWPOSSWP_DEFERERASESWP_DRAWFRAMESWP_FRAMECHANGEDSWP_HIDEWINDOWSWP_NOACTIVATESWP_NOCOPYBITSSWP_NOMOVESWP_NOOWNERZORDERSWP_NOREDRAWSWP_NOREPOSITIONSWP_NOSENDCHANGINGSWP_NOSIZESWP_NOZORDERSWP_SHOWWINDOWULW_ALPHAULW_COLORKEYULW_OPAQUEVK_CONTROLVK_LCONTROLVK_LMENUVK_LSHIFTVK_MENUVK_RCONTROLVK_RMENUVK_RSHIFTVK_SHIFTWH_CALLWNDPROCWH_KEYBOARDWH_KEYBOARD_LLWH_MOUSEWH_MOUSE_LLWM_CHARWM_CLOSEWM_COPYDATAWM_CREATEWM_DESTROYWM_DEVICECHANGEWM_DRAWITEMWM_GETICONWM_HOTKEYWM_KEYDOWNWM_KEYUPWM_MDIMAXIMIZEWM_PAINTWM_QUITWM_SESSION_CHANGEWM_SHOWWINDOWWM_SIZEWM_SYSCOMMANDWM_SYSKEYDOWNWM_SYSKEYUPWM_USERWS_BORDERWS_CAPTIONWS_CHILDWS_CHILDWINDOWWS_CLIPCHILDRENWS_CLIPSIBLINGSWS_DISABLEDWS_DLGFRAMEWS_EX_COMPOSITEDWS_EX_LAYEREDWS_EX_TRANSPARENTWS_GROUPWS_HSCROLLWS_ICONICWS_MAXIMIZEWS_MAXIMIZEBOXWS_MINIMIZEWS_MINIMIZEBOXWS_OVERLAPPEDWS_OVERLAPPEDWINDOWWS_POPUPWS_POPUPWINDOWWS_SIZEBOXWS_SYSMENUWS_TABSTOPWS_THICKFRAMEWS_TILEDWS_TILEDWINDOWWS_VISIBLEWS_VSCROLL
Inherited from com.sun.jna.win32.StdCallLibrary:
FUNCTION_MAPPERSTDCALL_CONVENTION

Method Summary

Modifier and TypeMethod and Description
public WinDef.BOOL

Returns:

The number of characters copied to the specified buffer indicates success. Zero indicates failure. To get extended error information, call GetLastError.
AdjustWindowRect
(WinDef.RECT
A pointer to a RECT structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area.
lpRect
,
WinDef.DWORD
The window style of the window whose required size is to be calculated. Note that you cannot specify the WS_OVERLAPPED style.
dwStyle
,
WinDef.BOOL
Indicates whether the window has a menu.
bMenu
)

Calculates the required size of the window rectangle, based on the desired client-rectangle size.

public WinDef.BOOL

Returns:

The number of characters copied to the specified buffer indicates success. Zero indicates failure. To get extended error information, call GetLastError.
AdjustWindowRectEx
(WinDef.RECT
A pointer to a RECT structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area.
lpRect
,
WinDef.DWORD
The window style of the window whose required size is to be calculated. Note that you cannot specify the WS_OVERLAPPED style.
dwStyle
,
WinDef.BOOL
Indicates whether the window has a menu.
bMenu
,
WinDef.DWORD
The extended window style of the window whose required size is to be calculated.
dwExStyle
)

Calculates the required size of the window rectangle, based on the desired client-rectangle size.

public boolean

Returns:

If the function succeeds, the return value is nonzero.
AttachThreadInput
(WinDef.DWORD
The identifier of the thread to be attached to another thread. The thread to be attached cannot be a system thread.
idAttach
,
WinDef.DWORD
The identifier of the thread to which idAttach will be attached. This thread cannot be a system thread. A thread cannot attach to itself. Therefore, idAttachTo cannot equal idAttach.
idAttachTo
,
boolean
If this parameter is TRUE, the two threads are attached. If the parameter is FALSE, the threads are detached.
fAttach
)

Attaches or detaches the input processing mechanism of one thread to that of another thread.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
BringWindowToTop
(WinDef.HWND
A handle to the window to bring to the top of the Z order.
hWnd
)

Brings the specified window to the top of the Z order.

public WinDef.LRESULT

Returns:

This value is returned by the next hook procedure in the chain. The current hook procedure must also return this value. The meaning of the return value depends on the hook type.
CallNextHookEx
(WinUser.HHOOK
Ignored.
hhk
,
int
Specifies the hook code passed to the current hook procedure. The next hook procedure uses this code to determine how to process the hook information.
nCode
,
WinDef.WPARAM
Specifies the wParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.
wParam
,
WinDef.LPARAM
Specifies the lParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.
lParam
)

The CallNextHookEx function passes the hook information to the next hook procedure in the current hook chain.

public WinDef.LRESULT

Returns:

The return value is the result of the message processing and depends on the message.

If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError.

CallWindowProc
(Pointer
The previous window procedure. If this value is obtained by calling the GetWindowLong function with the nIndex parameter set to GWL_WNDPROC or DWL_DLGPROC, it is actually either the address of a window or dialog box procedure, or a special internal value meaningful only to CallWindowProc.
lpPrevWndFunc
,
WinDef.HWND
A handle to the window procedure to receive the message.
hWnd
,
int
The message.
Msg
,
WinDef.WPARAM
Additional message information. The content of this parameter depends on the value of the Msg parameter.
wParam
,
WinDef.LPARAM
Additional message information. The content of this parameter depends on the value of the Msg parameter.
lParam
)

Passes message information to the specified window procedure.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
CloseWindow
(WinDef.HWND
A handle to the window to be minimized.
hWnd
)

Minimizes (but does not destroy) the specified window.

public WinDef.HICON

Returns:

If the function succeeds, the return value is a handle to the duplicate icon.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
CopyIcon
(WinDef.HICON
A handle to the icon to be copied.
hIcon
)

Copies the specified icon from another module to the current module.

public WinDef.HWND

Returns:

Type: HWND If the function succeeds, the return value is a handle to the new window. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

This function typically fails for one of the following reasons:

  • an invalid parameter value
  • the system class was registered by a different module
  • The WH_CBT hook is installed and returns a failure code
  • if one of the controls in the dialog template is not registered, or its window window procedure fails WM_CREATE or WM_NCCREATE
CreateWindowEx
(int
[in] Type: DWORD The extended window style of the window being created. For a list of possible values,see Extended Window Styles.
dwExStyle
,
String
[in, optional] Type: LPCTSTR A null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names.
lpClassName
,
String
[in, optional] Type: LPCTSTR The window name. If the window style specifies a title bar, the window title pointed to by lpWindowName is displayed in the title bar. When using CreateWindow to create controls, such as buttons, check boxes, and static controls, use lpWindowName to specify the text of the control. When creating a static control with the SS_ICON style, use lpWindowName to specify the icon name or identifier. To specify an identifier, use the syntax "#num".
lpWindowName
,
int
[in] Type: DWORD The style of the window being created. This parameter can be a combination of the window style values, plus the control styles indicated in the Remarks section.
dwStyle
,
int
[in] Type: int The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner of the parent window's client area. If x is set to CW_USEDEFAULT, the system selects the default position for the window's upper-left corner and ignores the y parameter. CW_USEDEFAULT is valid only for overlapped windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero.
x
,
int
[in] Type: int The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left corner of the parent window's client area. For a list box y is the initial y-coordinate of the upper-left corner of the list box's client area relative to the upper-left corner of the parent window's client area. If an overlapped window is created with the WS_VISIBLE style bit set and the x parameter is set to CW_USEDEFAULT, then the y parameter determines how the window is shown. If the y parameter is CW_USEDEFAULT, then the window manager calls ShowWindow with the SW_SHOW flag after the window has been created. If the y parameter is some other value, then the window manager calls ShowWindow with that value as the nCmdShow parameter.
y
,
int
[in] Type: int The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in screen coordinates, or CW_USEDEFAULT. If nWidth is CW_USEDEFAULT, the system selects a default width and height for the window; the default width extends from the initial x-coordinates to the right edge of the screen; the default height extends from the initial y-coordinate to the top of the icon area. CW_USEDEFAULT is valid only for overlapped windows; if CW_USEDEFAULT is specified for a pop-up or child window, the nWidth and nHeight parameter are set to zero.
nWidth
,
int
[in] Type: int The height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If the nWidth parameter is set to CW_USEDEFAULT, the system ignores nHeight.
nHeight
,
WinDef.HWND
[in, optional] Type: HWND A handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows. To create a message-only window, supply HWND_MESSAGE or a handle to an existing message-only window.
hWndParent
,
WinDef.HMENU
[in, optional] Type: HMENU A handle to a menu, or specifies a child-window identifier, depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window.
hMenu
,
WinDef.HINSTANCE
[in, optional] Type: HINSTANCE A handle to the instance of the module to be associated with the window.
hInstance
,
WinDef.LPVOID
[in, optional] Type: LPVOID Pointer to a value to be passed to the window through the CREATESTRUCT structure (lpCreateParams member) pointed to by the lParam param of the WM_CREATE message. This message is sent to the created window by this function before it returns. If an application calls CreateWindow to create a MDI client window, lpParam should point to a CLIENTCREATESTRUCT structure. If an MDI client window calls CreateWindow to create an MDI child window, lpParam should point to a MDICREATESTRUCT structure. lpParam may be NULL if no additional data is needed.
lpParam
)

Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function.

public WinDef.LRESULT

Returns:

Type: LRESULT The return value is the result of the message processing and depends on the message. If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError.
DefWindowProc
(WinDef.HWND
[in] Type: HWND A handle to the window procedure that received the message.
hWnd
,
int
[in] Type: UINT The message.
Msg
,
WinDef.WPARAM
[in] Type: WPARAM Additional message information. The content of this parameter depends on the value of the Msg parameter.
wParam
,
WinDef.LPARAM
[in] Type: LPARAM Additional message information. The content of this parameter depends on the value of the Msg parameter.
lParam
)

Calls the default window procedure to provide default processing for any window messages that an application does not process.

public boolean

Returns:

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
DestroyIcon
(WinDef.HICON
Handle to the icon to be destroyed. The icon must not be in use.
hicon
)

This function destroys an icon and frees any memory the icon occupied.

public boolean

Returns:

Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError.
DestroyWindow
(WinDef.HWND
[in] Type: HWND A handle to the window to be destroyed.
hWnd
)

Destroys the specified window.

public WinDef.LRESULT

Returns:

The return value specifies the value returned by the window procedure. Although its meaning depends on the message being dispatched, the return value generally is ignored.
DispatchMessage
(WinUser.MSG
Pointer to an MSG structure that contains the message.
lpMsg
)

This function dispatches a message to a window procedure.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. If EnumChildProc returns zero, the return value is also zero. In this case, the callback function should call SetLastError to obtain a meaningful error code to be returned to the caller of EnumChildWindows.
EnumChildWindows
(WinDef.HWND
Handle to the parent window whose child windows are to be enumerated. If this parameter is NULL, this function is equivalent to EnumWindows.
hWnd
,
WinUser.WNDENUMPROC
Pointer to an application-defined callback function.
lpEnumFunc
,
Pointer
Specifies an application-defined value to be passed to the callback function.
data
)

The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function.

public WinDef.BOOL

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
EnumDisplayMonitors
(WinDef.HDC
A handle to a display device context that defines the visible region of interest. If this parameter is NULL, the hdcMonitor parameter passed to the callback function will be NULL, and the visible region of interest is the virtual screen that encompasses all the displays on the desktop.
hdc
,
WinDef.RECT
A pointer to a RECT structure that specifies a clipping rectangle. The region of interest is the intersection of the clipping rectangle with the visible region specified by hdc. If hdc is non-NULL, the coordinates of the clipping rectangle are relative to the origin of the hdc. If hdc is NULL, the coordinates are virtual-screen coordinates. This parameter can be NULL if you don't want to clip the region specified by hdc.
lprcClip
,
WinUser.MONITORENUMPROC
A pointer to an application-defined callback function.
lpfnEnum
,
WinDef.LPARAM
Application-defined data that EnumDisplayMonitors passes directly to the lpfnEnum function.
dwData
)

Enumerates display monitors (including invisible pseudo-monitors associated with the mirroring drivers) that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context.

public boolean

Returns:

If the callback function returns TRUE for all windows in the thread specified by dwThreadId, the return value is TRUE. If the callback function returns FALSE on any enumerated window, or if there are no windows found in the thread specified by dwThreadId, the return value is FALSE.
EnumThreadWindows
(int
Identifies the thread whose windows are to be enumerated.
dwThreadId
,
WinUser.WNDENUMPROC
Pointer to an application-defined callback function.
lpEnumFunc
,
Pointer
Specifies an application-defined value to be passed to the callback function.
data
)

The EnumThreadWindows function enumerates all nonchild windows associated with a thread by passing the handle to each window, in turn, to an application-defined callback function.

public boolean

Returns:

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
EnumWindows
(WinUser.WNDENUMPROC
Long pointer to an application-defined callback function.
lpEnumFunc
,
Pointer
Specifies an application-defined value to be passed to the callback function.
data
)

This function enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function.

public WinDef.BOOL

Returns:

If the function succeeds, the return value is nonzero. Because the function executes asynchronously, a nonzero return value indicates that the shutdown has been initiated. It does not indicate whether the shutdown will succeed. It is possible that the system, the user, or another application will abort the shutdown. If the function fails, the return value is zero. To get extended error information, call GetLastError.
ExitWindowsEx
(WinDef.UINT
The shutdown type. This parameter must include one of EWX_HYBRID_SHUTDOWN, EWX_LOGOFF, EWX_POWEROFF, EWX_REBOOT, EWX_RESTARTAPPS, or EWX_SHUTDOWN. This parameter can optionally include one of EWX_FORCE or EWX_FORCEIFHUNG.
uFlags
,
WinDef.DWORD
The reason for initiating the shutdown. This parameter must be one of the system shutdown reason codes. If this parameter is zero, the SHTDN_REASON_FLAG_PLANNED reason code will not be set and therefore the default action is an undefined shutdown that is logged as "No title for this reason could be found". By default, it is also an unplanned shutdown. Depending on how the system is configured, an unplanned shutdown triggers the creation of a file that contains the system state information, which can delay shutdown. Therefore, do not use zero for this parameter.
dReason
)

Logs off the interactive user, shuts down the system, or shuts down and restarts the system.

public WinDef.HWND

Returns:

A handle to the window that has the specified class name and window name indicates success. NULL indicates failure. To get extended error information, call GetLastError.
FindWindow
(String
Long pointer to a null-terminated string that specifies the class name or is an atom that identifies the class-name string. If this parameter is an atom, it must be a global atom created by a previous call to the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpClassName; the high-order word must be zero.
lpClassName
,
String
Long pointer to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match.
lpWindowName
)

This function retrieves the handle to the top-level window whose class name and window name match the specified strings.

public WinDef.HWND

Returns:

If the function succeeds, the return value is a handle to the window that has the specified class and window names.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
FindWindowEx
(WinDef.HWND
Type: HWND
A handle to the parent window whose child windows are to be searched.
If hwndParent is NULL, the function uses the desktop window as the parent window. The function searches among windows that are child windows of the desktop.
If hwndParent is HWND_MESSAGE, the function searches all message-only windows.
parent
,
WinDef.HWND
Type: HWND
A handle to a child window. The search begins with the next child window in the Z order. The child window must be a direct child window of hwndParent, not just a descendant window.
If hwndChildAfter is NULL, the search begins with the first child window of hwndParent.
Note that if both hwndParent and hwndChildAfter are NULL, the function searches all top-level and message-only windows.
child
,
String
Type: LPCTSTR
The class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be placed in the low-order word of lpszClass; the high-order word must be zero.
If lpszClass is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx , or any of the predefined control-class names, or it can be MAKEINTATOM(0x8000). In this latter case, 0x8000 is the atom for a menu class. For more information, see the Remarks section of this topic.
className
,
String
Type: LPCTSTR
The window name (the window's title). If this parameter is NULL, all window names match.
window
)

public boolean

Returns:

The return value specifies the window's state before the call to the FlashWindowEx function. If the window caption was drawn as active before the call, the return value is nonzero. Otherwise, the return value is zero.
FlashWindowEx
(WinUser.FLASHWINFO
Pointer to the FLASHWINFO structure.
pfwi
)

The FlashWindowEx function flashes the specified window.

public WinDef.HWND

Returns:

Type: HWND The return value is the handle to the active window attached to the calling thread's message queue. Otherwise, the return value is NULL.
GetActiveWindow
()

Retrieves the window handle to the active window attached to the calling thread's message queue.

public WinDef.HWND

Returns:

The return value is the handle to the ancestor window.
GetAncestor
(WinDef.HWND
A handle to the window whose ancestor is to be retrieved. If this parameter is the desktop window, the function returns NULL.
hwnd
,
int
The ancestor to be retrieved. This parameter can be one of the following values:
  • GA_PARENT (1) -- Retrieves the parent window. This does not include the owner, as it does with the GetParent function.
  • GA_ROOT (2) -- Retrieves the root window by walking the chain of parent windows..
  • GA_ROOTOWNER (3) -- Retrieves the owned root window by walking the chain of parent and owner windows returned by GetParent..
gaFlags
)

Retrieves the handle to the ancestor of the specified window.

public short

Returns:

If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down.
GetAsyncKeyState
(int
Specifies one of 256 possible virtual-key codes.
vKey
)

This function determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState.

public boolean

Returns:

Type: BOOL If the function finds a matching class and successfully copies the data, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError .
GetClassInfoEx
(WinDef.HINSTANCE
[in, optional] Type: HINSTANCE A handle to the instance of the application that created the class. To retrieve information about classes defined by the system (such as buttons or list boxes), set this parameter to NULL.
hinst
,
String
[in] Type: LPCTSTR The class name. The name must be that of a preregistered class or a class registered by a previous call to the RegisterClass or RegisterClassEx function. Alternatively, this parameter can be a class atom created by a previous call to RegisterClass or RegisterClassEx. The atom must be in the low-order word of lpszClass; the high-order word must be zero.
lpszClass
,
WinUser.WNDCLASSEX
[out] Type: LPWNDCLASSEX A pointer to a WNDCLASSEX structure that receives the information about the class.
lpwcx
)

Retrieves information about a window class, including a handle to the small icon associated with the window class.

public int

Returns:

Type: DWORD If the function succeeds, the return value is the requested value.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
GetClassLong
(WinDef.HWND
A handle to the window and, indirectly, the class to which the window belongs.
hWnd
,
int
The value to be retrieved. To retrieve a value from the extra class memory, specify the positive, zero-based byte offset of the value to be retrieved. Valid values are in the range zero through the number of bytes of extra class memory, minus four; for example, if you specified 12 or more bytes of extra class memory, a value of 8 would be an index to the third integer. To retrieve any other value from the WNDCLASSEX structure, specify one of the following values.
GCW_ATOM: -32
Retrieves an ATOM value that uniquely identifies the window class. This is the same atom that the RegisterClassEx function returns.
GCL_CBCLSEXTRA: -20
Retrieves the size, in bytes, of the extra memory associated with the class.
GCL_CBWNDEXTRA: -18
Retrieves the size, in bytes, of the extra window memory associated with each window in the class. For information on how to access this memory, see GetWindowLong.
GCL_HBRBACKGROUND: -10
Retrieves a handle to the background brush associated with the class.
GCL_HCURSOR: -12
Retrieves a handle to the cursor associated with the class.
GCL_HICON: -14
Retrieves a handle to the icon associated with the class.
GCL_HICONSM: -34
Retrieves a handle to the small icon associated with the class.
GCL_HMODULE: -16
Retrieves a handle to the module that registered the class.
GCL_MENUNAME: -8
Retrieves the address of the menu name string. The string identifies the menu resource associated with the class.
GCL_STYLE: -26
Retrieves the window-class style bits.
GCL_WNDPROC: -24
Retrieves the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure.
nIndex
)

Retrieves the specified 32-bit (DWORD) value from the WNDCLASSEX structure associated with the specified window.

public BaseTSD.ULONG_PTR

Returns:

If the function succeeds, the return value is the requested value.

If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError().

GetClassLongPtr
(WinDef.HWND
A handle to the window and, indirectly, the class to which the window belongs.
hWnd
,
int
The value to be retrieved. To retrieve a value from the extra class memory, specify the positive, zero-based byte offset of the value to be retrieved. Valid values are in the range zero through the number of bytes of extra class memory, minus eight; for example, if you specified 24 or more bytes of extra class memory, a value of 16 would be an index to the third integer.To retrieve any other value from the WNDCLASSEX structure, specify one of the following values: WinUser#GCW_ATOM etc.
nIndex
)

Retrieves the specified value from the WNDCLASSEX structure associated with the specified window.

public int

Returns:

The number of characters copied to the specified buffer indicates success. Zero indicates failure. To get extended error information, call GetLastError.
GetClassName
(WinDef.HWND
Handle to the window and, indirectly, the class to which the window belongs.
hWnd
,
char[]
Long pointer to the buffer that is to receive the class name string.
lpClassName
,
int
Specifies the length, in characters, of the buffer pointed to by the lpClassName parameter. The class name string is truncated if it is longer than the buffer.
nMaxCount
)

This function retrieves the name of the class to which the specified window belongs.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
GetClientRect
(WinDef.HWND
Handle to the window.
hWnd
,
WinDef.RECT
Long pointer to a RECT structure that structure that receives the client coordinates. The left and top members are zero. The right and bottom members contain the width and height of the window.
rect
)

This function retrieves the coordinates of a window's client area.

public boolean

Returns:

Type: BOOL.
Returns nonzero if successful or zero otherwise. To get extended error information, call GetLastError.
GetCursorPos
(WinDef.POINT
lpPoint [out]
Type: LPPOINT
A pointer to a POINT structure that receives the screen coordinates of the cursor.
p
)

Retrieves the position of the mouse cursor, in screen coordinates.

public WinDef.HDC

Returns:

The handle the device context for the specified window's client area indicates success. NULL indicates failure. To get extended error information, call GetLastError.
GetDC
(WinDef.HWND
Handle to the window whose device context is to be retrieved. If this value is NULL, GetDC retrieves the device context for the entire screen.
hWnd
)

This function retrieves a handle to a display device context (DC) for the client area of the specified window.

public WinDef.HWND

Returns:

Type: HWND The return value is a handle to the desktop window.
GetDesktopWindow
()

Retrieves a handle to the desktop window.

public WinDef.HWND

Returns:

The return value is a handle to the foreground window. The foreground window can be NULL in certain circumstances, such as when a window is losing activation.
GetForegroundWindow
()

Retrieves a handle to the foreground window (the window with which the user is currently working).

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
GetGUIThreadInfo
(int
Identifies the thread for which information is to be retrieved. To retrieve this value, use the GetWindowThreadProcessId function. If this parameter is NULL, the function returns information for the foreground thread.
idThread
,
WinUser.GUITHREADINFO
Pointer to a GUITHREADINFO structure that receives information describing the thread. Note that you must set GUITHREADINFO.cbSize to sizeof(GUITHREADINFO) before calling this function.
lpgui
)

Retrieves information about the active window or a specified graphical user interface (GUI) thread.

public boolean

Returns:

If the function succeeds, the return value is true and the function fills in the members of the specified ICONINFO structure.

If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError().

GetIconInfo
(WinDef.HICON
A handle to the icon or cursor.

To retrieve information about a standard icon or cursor, specify one of the following values and use the MAKEINTRESOURCE macro to create this value: WinUser#IDC_APPSTARTING etc.

hIcon
,
WinGDI.ICONINFO
A pointer to an ICONINFO structure. The function fills in the structure's members.
piconinfo
)

Retrieves information about the specified icon or cursor.

public WinDef.HKL

Returns:

The return value is the input locale identifier for the thread. The low word contains a Language Identifier for the input language and the high word contains a device handle to the physical layout of the keyboard.
GetKeyboardLayout
(int
The identifier of the thread to query, or 0 for the current thread.
idThread
)

Retrieves the active input locale identifier (formerly called the keyboard layout).

public int

Returns:

If the function succeeds, the return value is the number of input locale identifiers copied to the buffer or, if nBuff is zero, the return value is the size, in array elements, of the buffer needed to receive all current input locale identifiers. If the function fails, the return value is zero. To get extended error information, call GetLastError.
GetKeyboardLayoutList
(int
The maximum number of handles that the buffer can hold.
nBuff
,
WinDef.HKL[]
A pointer to the buffer that receives the array of input locale identifiers.
lpList
)

Retrieves the input locale identifiers (formerly called keyboard layout handles) corresponding to the current set of input locales in the system.

public boolean

Returns:

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
GetKeyboardLayoutName
(char[]
[in] Pointer to the buffer of at least KL_NAMELENGTH characters that is to receive the name of the keyboard layout, including the terminating null character.
pwszKLID
)

This function retrieves the name of the active keyboard layout.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
GetKeyboardState
(byte[]
Pointer to the 256-byte array that receives the status data for each virtual key.
lpKeyState
)

The GetKeyboardState function copies the status of the 256 virtual keys to the specified buffer.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError.
GetLastInputInfo
(WinUser.LASTINPUTINFO
structure that receives the time of the last input event
plii
)

Retrieves the time of the last input event.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
GetLayeredWindowAttributes
(WinDef.HWND
Handle to the layered window. A layered window is created by specifying WS_EX_LAYERED when creating the window with the CreateWindowEx function or by setting WS_EX_LAYERED via SetWindowLong after the window has been created.
hwnd
,
IntByReference
Pointer to a COLORREF value that receives the transparency color key to be used when composing the layered window. All pixels painted by the window in this color will be transparent. This can be NULL if the argument is not needed.
pcrKey
,
ByteByReference
Pointer to a BYTE that receives the Alpha value used to describe the opacity of the layered window. Similar to the SourceConstantAlpha member of the BLENDFUNCTION structure. When the variable referred to by pbAlpha is 0, the window is completely transparent. When the variable referred to by pbAlpha is 255, the window is opaque. This can be NULL if the argument is not needed.
pbAlpha
,
IntByReference
Pointer to a DWORD that receives a layering flag. This can be NULL if the argument is not needed.
pdwFlags
)

The GetLayeredWindowAttributes function retrieves the opacity and transparency color key of a layered window.

public int

Returns:

If the function retrieves a message other than WM_QUIT, the return value is nonzero.

If the function retrieves the WM_QUIT message, the return value is zero.

If there is an error, the return value is -1. For example, the function fails if hWnd is an invalid window handle or lpMsg is an invalid pointer. To get extended error information, call GetLastError.

GetMessage
(WinUser.MSG
Pointer to an MSG structure that receives message information from the thread's message queue.
lpMsg
,
WinDef.HWND
Handle to the window whose messages are to be retrieved. One value has a special meaning.
hWnd
,
int
Specifies the integer value of the lowest message value to be retrieved.
wMsgFilterMin
,
int
Specifies the integer value of the highest message value to be retrieved.
wMsgFilterMax
)

This function retrieves a message from the calling thread's message queue and places it in the specified structure.

public WinDef.BOOL

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
GetMonitorInfo
(WinUser.HMONITOR
A handle to the display monitor of interest.
hMonitor
,
WinUser.MONITORINFO
A pointer to a WinUser.MONITORINFO structure that receives information about the specified display monitor.
lpmi
)

Retrieves information about a display monitor.

public WinDef.BOOL

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
GetMonitorInfo
(WinUser.HMONITOR
A handle to the display monitor of interest.
hMonitor
,
WinUser.MONITORINFOEX
A pointer to a WinUser.MONITORINFOEX structure that receives information about the specified display monitor.
lpmi
)

Retrieves information about a display monitor.

public WinDef.HWND

Returns:

Type: HWND
If the window is a child window, the return value is a handle to the parent window. If the window is a top-level window with the WS_POPUP style, the return value is a handle to the owner window. If the function fails, the return value is NULL. To get extended error information, call GetLastError. This function typically fails for one of the following reasons:
  • The window is a top-level window that is unowned or does not have the WS_POPUP style
  • The owner window has WS_POPUP style
GetParent
(WinDef.HWND
A handle to the window whose parent window handle is to be retrieved.
hwnd
)

Retrieves a handle to the specified window's parent or owner.

public int

Returns:

If the function is successful, the return value is the number of devices stored in the buffer pointed to by pRawInputDeviceList. On any other error, the function returns -1 and GetLastError returns the error indication.
GetRawInputDeviceList
(WinUser.RAWINPUTDEVICELIST[]
An array of WinUser.RAWINPUTDEVICELIST structures for the devices attached to the system. If (@code null}, the number of devices is returned in puiNumDevices
pRawInputDeviceList
,
IntByReference
If pRawInputDeviceList is null, the function populates this variable with the number of devices attached to the system; otherwise, this variable specifies the number of WinUser.RAWINPUTDEVICELIST structures that can be contained in the buffer to which pRawInputDeviceList points. If this value is less than the number of devices attached to the system, the function returns the actual number of devices in this variable and fails with ERROR_INSUFFICIENT_BUFFER.
puiNumDevices
,
int
The size of a WinUser.RAWINPUTDEVICELIST structure, in bytes.
cbSize
)

public int

Returns:

If the function succeeds, the return value is the requested system metric or configuration setting. If the function fails, the return value is zero. GetLastError does not provide extended error information.
GetSystemMetrics
(int
System metric or configuration setting to retrieve. This parameter can be one of the following values. Note that all SM_CX* values are widths and all SM_CY* values are heights. Also note that all settings designed to return Boolean data represent TRUE as any nonzero value, and FALSE as a zero value.
nIndex
)

The GetSystemMetrics function retrieves various system metrics (widths and heights of display elements) and system configuration settings.

public WinDef.HWND

Returns:

If the function succeeds, the return value is a window handle. If no window exists with the specified relationship to the specified window, the return value is NULL. To get extended error information, call GetLastError.
GetWindow
(WinDef.HWND
A handle to a window. The window handle retrieved is relative to this window, based on the value of the uCmd parameter.
hWnd
,
WinDef.DWORD
The relationship between the specified window and the window whose handle is to be retrieved.
uCmd
)

Retrieves a handle to a window that has the specified relationship (Z-Order or owner) to the specified window.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
GetWindowInfo
(WinDef.HWND
Handle to the window whose information is to be retrieved.
hWnd
,
WinUser.WINDOWINFO
Pointer to a WINDOWINFO structure to receive the information. Note that you must set WINDOWINFO.cbSize to sizeof(WINDOWINFO) before calling this function.
pwi
)

The GetWindowInfo function retrieves information about the specified window.

public int

Returns:

The requested 32-bit value indicates success. Zero indicates failure. To get extended error information, call GetLastError.
GetWindowLong
(WinDef.HWND
Handle to the window and, indirectly, the class to which the window belongs.
hWnd
,
int
Specifies the zero-based offset to the value to be retrieved.
nIndex
)

This function retrieves information about the specified window.

public BaseTSD.LONG_PTR

Returns:

If the function succeeds, the return value is the requested value. If the function fails, the return value is zero. To get extended error information, call GetLastError. If SetWindowLong or SetWindowLongPtr has not been called previously, GetWindowLongPtr returns zero for values in the extra window or class memory.
GetWindowLongPtr
(WinDef.HWND
Handle to the window and, indirectly, the class to which the window belongs.
hWnd
,
int
Specifies the zero-based offset to the value to be retrieved.
nIndex
)

The GetWindowLongPtr function retrieves information about the specified window.

public int

Returns:

The return value is the total number of TCHARs copied into the buffer.
GetWindowModuleFileName
(WinDef.HWND
Handle to the window whose module file name will be retrieved.
hWnd
,
char[]
Pointer to a buffer that receives the path and file name.
lpszFileName
,
int
Specifies the maximum number of TCHARs that can be copied into the lpszFileName buffer.
cchFileNameMax
)

The GetWindowModuleFileName function retrieves the full path and file name of the module associated with the specified window handle.

public WinDef.BOOL

Returns:

The number of characters copied to the specified buffer indicates success. Zero indicates failure. To get extended error information, call GetLastError.
GetWindowPlacement
(WinDef.HWND
A handle to the window.
hwnd
,
WinUser.WINDOWPLACEMENT
A pointer to the WINDOWPLACEMENT structure that receives the show state and position information.
lpwndpl
)

Retrieves the show state and the restored, minimized, and maximized positions of the specified window.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
GetWindowRect
(WinDef.HWND
Handle to the window.
hWnd
,
WinDef.RECT
Long pointer to a RECT structure that receives the screen coordinates of the upper-left and lower-right corners of the window.
rect
)

This function retrieves the dimensions of the bounding rectangle of the specified window.

public int

Returns:

The length, in characters, of the copied string, not including the terminating null character, indicates success. Zero indicates that the window has no title bar or text, if the title bar is empty, or if the window or control handle is invalid. To get extended error information, call GetLastError. This function cannot retrieve the text of an edit control in another application.
GetWindowText
(WinDef.HWND
Handle to the window or control containing the text.
hWnd
,
char[]
Long pointer to the buffer that will receive the text.
lpString
,
int
Specifies the maximum number of characters to copy to the buffer, including the NULL character. If the text exceeds this limit, it is truncated.
nMaxCount
)

This function copies the text of the specified window's title bar - if it has one - into a buffer.

public int

Returns:

The length, in characters, of the text indicates success. Under certain conditions, this value may actually be greater than the length of the text. Zero indicates that the window has no text. To get extended error information, call GetLastError.
GetWindowTextLength
(WinDef.HWND
Handle to the window or control.
hWnd
)

This function retrieves the length, in characters, of the specified window's title bar text - if the window has a title bar.

public int

Returns:

The return value is the identifier of the thread that created the window.
GetWindowThreadProcessId
(WinDef.HWND
Handle to the window.
hWnd
,
IntByReference
Pointer to a 32-bit value that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the 32-bit value; otherwise, it does not.
lpdwProcessId
)

This function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
InvalidateRect
(WinDef.HWND
A handle to the window whose update region has changed. If this parameter is NULL, the system invalidates and redraws all windows, not just the windows for this application, and sends the WM_ERASEBKGND and WM_NCPAINT messages before the function returns. Setting this parameter to NULL is not recommended.
hWnd
,
WinDef.RECT
A pointer to a RECT structure that contains the client coordinates of the rectangle to be added to the update region. If this parameter is NULL, the entire client area is added to the update region.
lpRect
,
boolean
Specifies whether the background within the update region is to be erased when the update region is processed. If this parameter is TRUE, the background is erased when the BeginPaint function is called. If this parameter is FALSE, the background remains unchanged.
bErase
)

The InvalidateRect function adds a rectangle to the specified window's update region.

public boolean

Returns:

If the window handle identifies an existing window, the return value is true (nonzero).
If the window handle does not identify an existing window, the return value is false (zero).
IsWindow
(WinDef.HWND
A handle to the window to be tested.
hWnd
)

Determines whether the specified window handle identifies an existing window.

public boolean

Returns:

If the window is enabled, the return value is true (nonzero).
If the window is not enabled, the return value is false (zero).
IsWindowEnabled
(WinDef.HWND
A handle to the window to be tested.
hWnd
)

Determines whether the specified window is enabled for mouse and keyboard input.

public boolean

Returns:

If the specified window, its parent window, its parent's parent window, and so forth, have the WS_VISIBLE style, the return value is nonzero. Otherwise, the return value is zero. Because the return value specifies whether the window has the WS_VISIBLE style, it may be nonzero even if the window is totally obscured by other windows.
IsWindowVisible
(WinDef.HWND
A handle to the window to be tested.
hWnd
)

Determines the visibility state of the specified window.

public WinDef.HICON

Returns:

A handle to the newly loaded icon indicates success. NULL indicates failure. To get extended error information, call GetLastError.
LoadIcon
(WinDef.HINSTANCE
Handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must be NULL when a standard icon is being loaded.
hInstance
,
String
Long pointer to a null-terminated string that contains the name of the icon resource to be loaded. Alternatively, this parameter can contain the resource identifier in the low-order word and zero in the high-order word. Use the MAKEINTRESOURCE macro to create this value.

To use one of the predefined icons, set the hInstance parameter to NULL and the lpIconName parameter to one of the following values: WinUser#IDC_APPSTARTING etc.

iconName
)

This function loads the specified icon resource from the executable (.exe) file associated with an application instance.

public WinNT.HANDLE

Returns:

The handle of the newly loaded image indicates success. NULL indicates failure. To get extended error information, call GetLastError.
LoadImage
(WinDef.HINSTANCE
Handle to an instance of the module that contains the image to be loaded.
hinst
,
String
Pointer to a null-terminated string that contains the name of the image resource in the hinst module that identifies the image to load.
name
,
int
Specifies the type of image to be loaded.
type
,
int
Specifies the width, in pixels, of the icon or cursor. If this parameter is zero, the function uses the SM_CXICON or SM_CXCURSOR system metric value to set the width. If uType is IMAGE_BITMAP, this parameter must be zero.
xDesired
,
int
Specifies the height, in pixels, of the icon or cursor. If this parameter is zero, the function uses the SM_CYICON or SM_CYCURSOR system metric value to set the height. If uType is IMAGE_BITMAP, this parameter must be zero.
yDesired
,
int
Set to zero.
load
)

This function loads an icon, cursor, or bitmap.

public int

Returns:

If the function succeeds, the return value is the number of characters copied into the buffer, not including the terminating null character, or zero if the string resource does not exist. To get extended error information, call GetLastError.
LoadString
(WinDef.HINSTANCE
A handle to an instance of the module whose executable file contains the string resource. To get the handle to the application itself, call the GetModuleHandle function with NULL.
hInstance
,
int
The identifier of the string to be loaded.
uID
,
Pointer
The buffer is to receive the string. Must be of sufficient length to hold a pointer (8 bytes).
lpBuffer
,
int
The size of the buffer, in characters. The string is truncated and null-terminated if it is longer than the number of characters specified. If this parameter is 0, then lpBuffer receives a read-only pointer to the resource itself.
cchBufferMax
)

Loads a string resource from the executable file associated with a specified module, copies the string into a buffer, and appends a terminating null character.

public WinDef.BOOL

Returns:

If the function succeeds, the return value is nonzero. Because the function executes asynchronously, a nonzero return value indicates that the operation has been initiated. It does not indicate whether the workstation has been successfully locked. If the function fails, the return value is zero. To get extended error information, call GetLastError.
LockWorkStation
()

Locks the workstation's display.

public int

Returns:

The return value is either a scan code, a virtual-key code, or a character value, depending on the value of uCode and uMapType. If there is no translation, the return value is zero.
MapVirtualKeyEx
(int
The virtual-key code or scan code for a key. How this value is interpreted depends on the value of the uMapType parameter. Starting with Windows Vista, the high byte of the uCode value can contain either 0xe0 or 0xe1 to specify the extended scan code.
uCode
,
int
The translation to perform. The value of this parameter depends on the value of the uCode parameter. One of WinUser#MAPVK_VK_TO_CHAR, WinUser#MAPVK_VK_TO_VSC, WinUser#MAPVK_VK_TO_VSC_EX, WinUser#MAPVK_VSC_TO_VK, WinUser#MAPVK_VSC_TO_VK_EX
uMapType
,
WinDef.HKL
Input locale identifier to use for translating the specified code. This parameter can be any input locale identifier previously returned by the #LoadKeyboardLayout() function.
dwhkl
)

Translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code.

public WinUser.HMONITOR

Returns:

If the point is contained by a display monitor, the return value is an HMONITOR handle to that display monitor. If the point is not contained by a display monitor, the return value depends on the value of dwFlags.
MonitorFromPoint
(WinDef.POINT.ByValue
A POINT structure that specifies the point of interest in virtual-screen coordinates.
pt
,
int
Determines the function's return value if the window does not intersect any display monitor. This parameter can be one of the following values.
  • MONITOR_DEFAULTTONEAREST
  • MONITOR_DEFAULTTONULL
  • MONITOR_DEFAULTTOPRIMARY
dwFlags
)

Retrieves a handle to the display monitor that contains a specified point.

public WinUser.HMONITOR

Returns:

If the rectangle intersects one or more display monitor rectangles, the return value is an HMONITOR handle to the display monitor that has the largest area of intersection with the rectangle. If the rectangle does not intersect a display monitor, the return value depends on the value of dwFlags.
MonitorFromRect
(WinDef.RECT
A pointer to a RECT structure that specifies the rectangle of interest in virtual-screen coordinates.
lprc
,
int
Determines the function's return value if the window does not intersect any display monitor. This parameter can be one of the following values.
  • MONITOR_DEFAULTTONEAREST
  • MONITOR_DEFAULTTONULL
  • MONITOR_DEFAULTTOPRIMARY
dwFlags
)

Retrieves a handle to the display monitor that has the largest area of intersection with a specified rectangle.

public WinUser.HMONITOR

Returns:

If the window intersects one or more display monitor rectangles, the return value is an HMONITOR handle to the display monitor that has the largest area of intersection with the window. If the window does not intersect a display monitor, the return value depends on the value of dwFlags.
MonitorFromWindow
(WinDef.HWND
A handle to the window of interest.
hwnd
,
int
Determines the function's return value if the window does not intersect any display monitor. This parameter can be one of the following values.
  • MONITOR_DEFAULTTONEAREST
  • MONITOR_DEFAULTTONULL
  • MONITOR_DEFAULTTOPRIMARY
dwFlags
)

Retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
MoveWindow
(WinDef.HWND
A handle to the window.
hWnd
,
int
The new position of the left side of the window.
X
,
int
The new position of the top of the window.
Y
,
int
The new width of the window.
nWidth
,
int
The new height of the window.
nHeight
,
boolean
Indicates whether the window is to be repainted. If this parameter is TRUE, the window receives a message. If the parameter is FALSE, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of moving a child window.
bRepaint
)

Changes the position and dimensions of the specified window.

public boolean

Returns:

Nonzero indicates success. Zero indicates failure.
PeekMessage
(WinUser.MSG
Pointer to an MSG structure that receives message information.
lpMsg
,
WinDef.HWND
Handle to the window whose messages are to be examined.
hWnd
,
int
Specifies the value of the first message in the range of messages to be examined.
wMsgFilterMin
,
int
Specifies the value of the last message in the range of messages to be examined.
wMsgFilterMax
,
int
Specifies how messages are handled. This parameter can be one of the following values.
wRemoveMsg
)

This function checks a thread message queue for a message and places the message (if any) in the specified structure.

public void
PostMessage(WinDef.HWND
Handle to the window whose window procedure is to receive the message.
hWnd
,
int
Specifies the message to be posted.
msg
,
WinDef.WPARAM
Specifies additional message-specific information.
wParam
,
WinDef.LPARAM
Specifies additional message-specific information.
lParam
)

This function places a message in the message queue associated with the thread that created the specified window and then returns without waiting for the thread to process the message.

public void
PostQuitMessage(int
Specifies an application exit code. This value is used as the wParam parameter of the WM_QUIT message.
nExitCode
)

This function indicates to Windows that a thread has made a request to terminate (quit).

public int

Returns:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

GetLastError returns ERROR_INVALID_THREAD_ID if idThread is not a valid thread identifier, or if the thread specified by idThread does not have a message queue.

GetLastError returns ERROR_NOT_ENOUGH_QUOTA when the message limit is hit.

PostThreadMessage
(int
The identifier of the thread to which the message is to be posted.

The function fails if the specified thread does not have a message queue. The system creates a thread's message queue when the thread makes its first call to one of the User or GDI functions.

Message posting is subject to UIPI. The thread of a process can post messages only to posted-message queues of threads in processes of lesser or equal integrity level.

This thread must have the SE_TCB_NAME privilege to post a message to a thread that belongs to a process with the same locally unique identifier (LUID) but is in a different desktop. Otherwise, the function fails and returns ERROR_INVALID_THREAD_ID.

This thread must either belong to the same desktop as the calling thread or to a process with the same LUID. Otherwise, the function fails and returns ERROR_INVALID_THREAD_ID.

idThread
,
int
The type of message to be posted.
Msg
,
WinDef.WPARAM
Additional message-specific information.
wParam
,
WinDef.LPARAM
Additional message-specific information.
lParam
)

Posts a message to the message queue of the specified thread.

public boolean

Returns:

If the function succeeds, it returns true (MSDN: a nonzero value). If the function fails, it returns false (MSDN: zero).
PrintWindow
(WinDef.HWND
A handle to the window that will be copied.
hWnd
,
WinDef.HDC
A handle to the destination device context.
dest
,
int
The drawing options. It can be one of the following values:
PW_CLIENTONLY:
Only the client area of the window is copied to hdcBlt. By default, the entire window is copied.
flags
)

The PrintWindow function copies a visual window into the specified device context (DC), typically a printer DC.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
RedrawWindow
(WinDef.HWND
A handle to the window to be redrawn. If this parameter is NULL, the desktop window is updated.
hWnd
,
WinDef.RECT
A pointer to a RECT structure containing the coordinates, in device units, of the update rectangle. This parameter is ignored if the hrgnUpdate parameter identifies a region.
lprcUpdate
,
WinDef.HRGN
A handle to the update region. If both the hrgnUpdate and lprcUpdate parameters are NULL, the entire client area is added to the update region.
hrgnUpdate
,
WinDef.DWORD
One or more redraw flags. This parameter can be used to invalidate or validate a window, control repainting, and control which windows are affected by RedrawWindow.
flags
)

The RedrawWindow function updates the specified rectangle or region in a window's client area.

public WinDef.ATOM

Returns:

If the function succeeds, the return value is a class atom that uniquely identifies the class being registered. This atom can only be used by the CreateWindow, CreateWindowEx, GetClassInfo, GetClassInfoEx, FindWindow, FindWindowEx, and UnregisterClass functions and the IActiveIMMap::FilterClientWindows method. If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError.
RegisterClassEx
(WinUser.WNDCLASSEX
Type: const WNDCLASSEX* A pointer to a WNDCLASSEX structure. You must fill the structure with the appropriate class attributes before passing it to the function.
lpwcx
)

Registers a window class for subsequent use in calls to the CreateWindow or CreateWindowEx function.

public int

Returns:

If the function succeeds, the return value identifies the registered clipboard format.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

RegisterClipboardFormat
(String
The name of the new format.
formatName
)

Registers a new clipboard format.

public WinUser.HDEVNOTIFY

Returns:

value If the function succeeds, the return value is a device notification handle. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
RegisterDeviceNotification
(WinNT.HANDLE
[in] A handle to the window or service that will receive device events for the devices specified in the NotificationFilter parameter. The same window handle can be used in multiple calls to RegisterDeviceNotification. Services can specify either a window handle or service status handle.
hRecipient
,
Structure
[in] A pointer to a block of data that specifies the type of device for which notifications should be sent. This block always begins with the DEV_BROADCAST_HDR structure. The data following this header is dependent on the value of the dbch_devicetype member, which can be DBT_DEVTYP_DEVICEINTERFACE or DBT_DEVTYP_HANDLE. For more information, see Remarks.
notificationFilter
,
int
[in] This parameter can be one of the following values. DEVICE_NOTIFY_WINDOW_HANDLE0x00000000 The hRecipient parameter is a window handle. DEVICE_NOTIFY_SERVICE_HANDLE0x00000001 The hRecipient parameter is a service status handle. In addition, you can specify the following value. DEVICE_NOTIFY_ALL_INTERFACE_CLASSES0x00000004 Notifies the recipient of device interface events for all device interface classes. (The dbcc_classguid member is ignored.) This value can be used only if the dbch_devicetype member is DBT_DEVTYP_DEVICEINTERFACE.
Flags
)

Registers the device or type of device for which a window will receive notifications.

public boolean

Returns:

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError. WinUser#WM_HOTKEY messages generated by the hot key WinUser#WM_HOTKEY message.

A combination of the following values
  • WinUser#MOD_ALT Either ALT key must be held down.
  • WinUser#MOD_CONTROL Either CTRL key must be held down.
  • WinUser#MOD_NOREPEAT Changes the hotkey behavior so that the keyboard auto-repeat does not yield multiple hotkey notifications.

    Windows Vista and Windows XP/2000: This flag is not supported.

  • WinUser#MOD_SHIFT Either SHIFT key must be held down.
  • WinUser#MOD_WIN Either WINDOWS key was held down. These keys are labeled with the Windows logo.
RegisterHotKey
(WinDef.HWND
A handle to the window that will receive
hWnd
,
int
The identifier of the hot key
id
,
int
The keys that must be pressed in combination with the key specified by the uVirtKey parameter in order to generate the
fsModifiers
,
int
The virtual-key code of the hot key
vk
)

Defines a system-wide hot key.

public int

Returns:

If the message is successfully registered, the return value is a message identifier in the range 0xC000 through 0xFFFF.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

RegisterWindowMessage
(String
The message to be registered.
string
)

Defines a new window message that is guaranteed to be unique throughout the system.

public int

Returns:

The return value specifies whether the device context is released. 1 indicates that the device context is released. Zero indicates that the device context is not released.
ReleaseDC
(WinDef.HWND
Handle to the window whose device context is to be released.
hWnd
,
WinDef.HDC
Handle to the device context to be released.
hDC
)

This function releases a device context (DC), freeing it for use by other applications.

public WinDef.DWORD

Returns:

The function returns the number of events that it successfully inserted into the keyboard or mouse input stream. If the function returns zero, the input was already blocked by another thread. To get extended error information, call GetLastError. This function fails when it is blocked by UIPI. Note that neither GetLastError nor the return value will indicate the failure was caused by UIPI blocking.
SendInput
(WinDef.DWORD
The number of structures in the pInputs array.
nInputs
,
WinUser.INPUT[]
An array of INPUT structures. Each structure represents an event to be inserted into the keyboard or mouse input stream.
pInputs
,
int
The size, in bytes, of an INPUT structure. If cbSize is not the size of an INPUT structure, the function fails.
cbSize
)

Synthesizes keystrokes, mouse motions, and button clicks.

public WinDef.LRESULT

Returns:

The return value specifies the result of the message processing; it depends on the message sent. Two classic usage : - with a WM_USER+x msg value : wParam and lParam are numeric values - with a WM_COPYDATA msg value : wParam is the length of the structure and lParam a pointer to a COPYDATASTRUCT
SendMessage
(WinDef.HWND
A handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST ((HWND)0xffff), the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows. Message sending is subject to UIPI. The thread of a process can send messages only to message queues of threads in processes of lesser or equal integrity level.
hWnd
,
int
The message to be sent. For lists of the system-provided messages, see System-Defined Messages.
msg
,
WinDef.WPARAM
Additional message-specific information.
wParam
,
WinDef.LPARAM
Additional message-specific information.
lParam
)

Sends the specified message to a window or windows.

public WinDef.LRESULT

Returns:

If the function succeeds, the return value is nonzero. SendMessageTimeout does not provide information about individual windows timing out if HWND_BROADCAST is used.

If the function fails or times out, the return value is 0. To get extended error information, call GetLastError. If GetLastError returns ERROR_TIMEOUT, then the function timed out.

Windows 2000: If Kernel32#GetLastError() returns 0, then the function timed out.
SendMessageTimeout
(WinDef.HWND
A handle to the window whose window procedure will receive the message.

If this parameter is HWND_BROADCAST ((HWND)0xffff), the message is sent to all top-level windows in the system, including disabled or invisible unowned windows. The function does not return until each window has timed out. Therefore, the total wait time can be up to the value of uTimeout multiplied by the number of top-level windows.

hWnd
,
int
The message to be sent.
msg
,
WinDef.WPARAM
Any additional message-specific information.
wParam
,
WinDef.LPARAM
Any additional message-specific information.
lParam
,
int
The behavior of this function. This parameter can be one or more of the following values: WinUser#SMTO_ABORTIFHUNG etc.
fuFlags
,
int
The duration of the time-out period, in milliseconds. If the message is a broadcast message, each window can use the full time-out period. For example, if you specify a five second time-out period and there are three top-level windows that fail to process the message, you could have up to a 15 second delay.
uTimeout
,
WinDef.DWORDByReference
The result of the message processing. The value of this parameter depends on the message that is specified.
lpdwResult
)

Sends the specified message to one or more windows.

public boolean

Returns:

Type: BOOL.
Returns nonzero if successful or zero otherwise. To get extended error information, call GetLastError.
SetCursorPos
(long
The new x-coordinate of the cursor, in screen coordinates.
x
,
long
The new y-coordinate of the cursor, in screen coordinates.
y
)

Moves the cursor to the specified screen coordinates.

public WinDef.HWND

Returns:

If the function succeeds, the return value is the handle to the window that previously had the keyboard focus. If the hWnd parameter is invalid or the window is not attached to the calling thread's message queue, the return value is NULL. To get extended error information, call GetLastError.
SetFocus
(WinDef.HWND
A handle to the window that will receive the keyboard input. If this parameter is NULL, keystrokes are ignored.
hWnd
)

Sets the keyboard focus to the specified window.

public boolean

Returns:

If the window was brought to the foreground, the return value is nonzero.
SetForegroundWindow
(WinDef.HWND
A handle to the window that should be activated and brought to the foreground.
hWnd
)

Brings the thread that created the specified window into the foreground and activates the window.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
SetLayeredWindowAttributes
(WinDef.HWND
Handle to the layered window.
hwnd
,
int
COLORREF structure that specifies the transparency color key to be used when composing the layered window.
crKey
,
byte
Alpha value used to describe the opacity of the layered window.
bAlpha
,
int
Specifies an action to take.
dwFlags
)

The SetLayeredWindowAttributes function sets the opacity and transparency color key of a layered window.

public WinDef.HWND

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
SetParent
(WinDef.HWND
A handle to the child window.
hWndChild
,
WinDef.HWND
A handle to the new parent window. If this parameter is NULL, the desktop window becomes the new parent window. If this parameter is HWND_MESSAGE, the child window becomes a message-only window.
hWndNewParent
)

Changes the parent window of the specified child window.

public int

Returns:

The previous value of the specified 32-bit integer indicates success. Zero indicates failure. To get extended error information, call GetLastError.
SetWindowLong
(WinDef.HWND
Handle to the window and, indirectly, the class to which the window belongs.
hWnd
,
int
Specifies the zero-based offset to the value to be set.
nIndex
,
int
Specifies the replacement value.
dwNewLong
)

This function changes an attribute of the specified window.

public Pointer

Returns:

If the function succeeds, the return value is the previous value of the specified offset. If the function fails, the return value is zero. To get extended error information, call GetLastError. If the previous value is zero and the function succeeds, the return value is zero, but the function does not clear the last error information. To determine success or failure, clear the last error information by calling SetLastError(0), then call SetWindowLongPtr. Function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.
SetWindowLongPtr
(WinDef.HWND
Handle to the window and, indirectly, the class to which the window belongs.
hWnd
,
int
Specifies the zero-based offset to the value to be set.
nIndex
,
Pointer
Specifies the replacement value.
dwNewLongPtr
)

The SetWindowLongPtr function changes an attribute of the specified window.

public WinDef.BOOL

Returns:

The number of characters copied to the specified buffer indicates success. Zero indicates failure. To get extended error information, call GetLastError.
SetWindowPlacement
(WinDef.HWND
A handle to the window.
hwnd
,
WinUser.WINDOWPLACEMENT
A pointer to a WINDOWPLACEMENT structure that specifies the new show state and window positions.
lpwndpl
)

Sets the show state and the restored, minimized, and maximized positions of the specified window.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
SetWindowPos
(WinDef.HWND
A handle to the window.
hWnd
,
WinDef.HWND
A handle to the window to precede the positioned window in the Z order.
hWndInsertAfter
,
int
The new position of the left side of the window, in client coordinates.
X
,
int
The new position of the top of the window, in client coordinates.
Y
,
int
The new width of the window, in pixels.
cx
,
int
The new height of the window, in pixels.
cy
,
int
The window sizing and positioning flags.
uFlags
)

Changes the size, position, and Z order of a child, pop-up, or top-level window.

public int

Returns:

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
SetWindowRgn
(WinDef.HWND
Handle to the window whose window region is to be set.
hWnd
,
WinDef.HRGN
Handle to a region. The function sets the window region of the window to this region. If hRgn is NULL, the function sets the window region to NULL.
hRgn
,
boolean
Specifies whether the system redraws the window after setting the window region. If bRedraw is TRUE, the system does so; otherwise, it does not. Typically, you set bRedraw to TRUE if the window is visible.
bRedraw
)

This function sets the window region of a window.

public WinUser.HHOOK

Returns:

If the function succeeds, the return value is the handle to the hook procedure. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
SetWindowsHookEx
(int
Specifies the type of hook procedure to be installed.
idHook
,
WinUser.HOOKPROC
Pointer to the hook procedure.
lpfn
,
WinDef.HINSTANCE
Handle to the DLL containing the hook procedure pointed to by the lpfn parameter.
hMod
,
int
Specifies the identifier of the thread with which the hook procedure is to be associated.
dwThreadId
)

The SetWindowsHookEx function installs an application-defined hook procedure into a hook chain.

public WinNT.HANDLE

Returns:

Type: HWINEVENTHOOK
If successful, returns an HWINEVENTHOOK value that identifies this event hook instance. Applications save this return value to use it with the UnhookWinEvent function.
If unsuccessful, returns zero.
SetWinEventHook
(int
Type: UINT
Specifies the event constant for the lowest event value in the range of events that are handled by the hook function.
This parameter can be set to EVENT_MIN to indicate the lowest possible event value.
eventMin
,
int
Type: UINT
Specifies the event constant for the highest event value in the range of events that are handled by the hook function.
This parameter can be set to EVENT_MAX to indicate the highest possible event value.
eventMax
,
WinDef.HMODULE
Type: HMODULE
Handle to the DLL that contains the hook function at lpfnWinEventProc, if the WINEVENT_INCONTEXT flag is specified in the dwFlags parameter.
If the hook function is not located in a DLL, or if the WINEVENT_OUTOFCONTEXT flag is specified, this parameter is NULL.
hmodWinEventProc
,
WinUser.WinEventProc
Type: WINEVENTPROC
Pointer to the event hook function. For more information about this function, see WinEventProc.
winEventProc
,
int
Type: DWORD
Specifies the ID of the process from which the hook function receives events.
Specify zero (0) to receive events from all processes on the current desktop.
processID
,
int
Type: DWORD
Specifies the ID of the thread from which the hook function receives events.
If this parameter is zero, the hook function is associated with all existing threads on the current desktop.
threadID
,
int
Type: UINT
Flag values that specify the location of the hook function and of the events to be skipped.
The following flags are valid:
  • WINEVENT_INCONTEXT: The DLL that contains the callback function is mapped into the address space of the process that generates the event.
    With this flag, the system sends event notifications to the callback function as they occur.
    The hook function must be in a DLL when this flag is specified.
    This flag has no effect when both the calling process and the generating process are not 32-bit or 64-bit processes, or when the generating process is a console application.
    For more information, see In-Context Hook Functions.
  • WINEVENT_OUTOFCONTEXT: The callback function is not mapped into the address space of the process that generates the event.
    Because the hook function is called across process boundaries, the system must queue events.
    Although this method is asynchronous, events are guaranteed to be in sequential order.
    For more information, see Out-of-Context Hook Functions.
  • WINEVENT_SKIPOWNPROCESS:
    Prevents this instance of the hook from receiving the events that are generated by threads in this process.
    This flag does not prevent threads from generating events.
  • WINEVENT_SKIPOWNTHREAD:
    Prevents this instance of the hook from receiving the events that are generated by the thread that is registering this hook.
flags
)

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
ShowWindow
(WinDef.HWND
A handle to the window.
hWnd
,
int
Controls how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter.
nCmdShow
)

Sets the specified window's show state.

public int

Returns:

The function returns one of the following values.
-1
The specified virtual key is a dead-key character (accent or diacritic). This value is returned regardless of the keyboard layout, even if several characters have been typed and are stored in the keyboard state. If possible, even with Unicode keyboard layouts, the function has written a spacing version of the dead-key character to the buffer specified by pwszBuff. For example, the function writes the character SPACING ACUTE (0x00B4), rather than the character NON_SPACING ACUTE (0x0301).
0
The specified virtual key has no translation for the current state of the keyboard. Nothing was written to the buffer specified by pwszBuff.
1
One character was written to the buffer specified by pwszBuff.
2≤value
Two or more characters were written to the buffer specified by pwszBuff. The most common cause for this is that a dead-key character (accent or diacritic) stored in the keyboard layout could not be combined with the specified virtual key to form a single character. However, the buffer may contain more characters than the return value specifies. When this happens, any extra characters are invalid and should be ignored.
ToUnicodeEx
(int
The virtual-key code to be translated.
wVirtKey
,
int
The hardware scan code of the key to be translated. The high-order bit of this value is set if the key is up.
wScanCode
,
byte[]
A pointer to a 256-byte array that contains the current keyboard state. Each element (byte) in the array contains the state of one key. If the high-order bit of a byte is set, the key is down.
lpKeyState
,
char[]
The buffer that receives the translated Unicode character or characters. However, this buffer may be returned without being null-terminated even though the variable name suggests that it is null-terminated.
pwszBuff
,
int
The size, in characters, of the buffer pointed to by the pwszBuff parameter.
cchBuff
,
int
The behavior of the function. If bit 0 is set, a menu is active. If bit 2 is set, keyboard state is not changed (Windows 10, version 1607 and newer) All other bits (through 31) are reserved.
wFlags
,
WinDef.HKL
Input locale identifier to use for translating the specified code. This parameter can be any input locale identifier previously returned by the #LoadKeyboardLayout() function.
dwhkl
)

Translates the specified virtual-key code and keyboard state to the corresponding Unicode character or characters.

public boolean

Returns:

Nonzero indicates that the message is translated, that is, a character message is posted to the thread's message queue. If the message is WM_KEYDOWN or WM_SYSKEYDOWN, the return value is nonzero, regardless of the translation. Zero indicates that the message is not translated, that is, a character message is not posted to the thread's message queue.
TranslateMessage
(WinUser.MSG
Pointer to an MSG structure that contains message information retrieved from the calling thread's message queue by using the GetMessage or PeekMessage function.
lpMsg
)

This function translates virtual-key messages into character messages.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
UnhookWindowsHookEx
(WinUser.HHOOK
Handle to the hook to be removed. This parameter is a hook handle obtained by a previous call to SetWindowsHookEx.
hhk
)

The UnhookWindowsHookEx function removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.

public boolean

Returns:

Type: BOOL If successful, returns TRUE; otherwise, returns FALSE.
Three common errors cause this function to fail:
The hWinEventHook parameter is NULL or not valid.
The event hook specified by hWinEventHook was already removed.
UnhookWinEvent is called from a thread that is different from the original call to SetWinEventHook.
UnhookWinEvent
(WinNT.HANDLE
Type: HWINEVENTHOOK
Handle to the event hook returned in the previous call to SetWinEventHook.
hook
)

Removes an event hook function created by a previous call to SetWinEventHook.

public boolean

Returns:

Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError.
UnregisterClass
(String
[in] Type: LPCTSTR A null-terminated string or a class atom. If lpClassName is a string, it specifies the window class name. This class name must have been registered by a previous call to the RegisterClass or RegisterClassEx function. System classes, such as dialog box controls, cannot be unregistered. If this parameter is an atom, it must be a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.
lpClassName
,
WinDef.HINSTANCE
[in,optional] Type: HINSTANCE A handle to the instance of the module that created the class. *
hInstance
)

Unregisters a window class, freeing the memory required for the class.

public boolean

Returns:

Return value If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
UnregisterDeviceNotification
(WinUser.HDEVNOTIFY
[in] Device notification handle returned by the RegisterDeviceNotification function.
Handle
)

Closes the specified device notification handle.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call Kernel32#GetLastError.
UnregisterHotKey
(Pointer
A handle to the window associated with the hot key to be freed. This parameter should be NULL if the hot key is not associated with a window.
hWnd
,
int
The identifier of the hot key to be freed.
id
)

Frees a hot key previously registered by the calling thread.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
UpdateLayeredWindow
(WinDef.HWND
Handle to a layered window. A layered window is created by specifying WS_EX_LAYERED when creating the window with the CreateWindowEx function.
hwnd
,
WinDef.HDC
Handle to a device context (DC) for the screen. This handle is obtained by specifying NULL when calling the function. It is used for palette color matching when the window contents are updated. If hdcDst isNULL, the default palette will be used. If hdcSrc is NULL, hdcDst must be NULL.
hdcDst
,
WinDef.POINT
Pointer to a POINT structure that specifies the new screen position of the layered window. If the current position is not changing, pptDst can be NULL.
pptDst
,
WinUser.SIZE
Pointer to a SIZE structure that specifies the new size of the layered window. If the size of the window is not changing, psize can be NULL. If hdcSrc is NULL, psize must be NULL.
psize
,
WinDef.HDC
Handle to a DC for the surface that defines the layered window. This handle can be obtained by calling the CreateCompatibleDC function. If the shape and visual context of the window are not changing, hdcSrc can be NULL.
hdcSrc
,
WinDef.POINT
Pointer to a POINT structure that specifies the location of the layer in the device context. If hdcSrc is NULL, pptSrc should be NULL.
pptSrc
,
int
Pointer to a COLORREF value that specifies the color key to be used when composing the layered window. To generate a COLORREF, use the RGB macro.
crKey
,
WinUser.BLENDFUNCTION
Pointer to a BLENDFUNCTION structure that specifies the transparency value to be used when composing the layered window.
pblend
,
int
ULW_* flags.
dwFlags
)

The UpdateLayeredWindow function updates the position, size, shape, content, and translucency of a layered window.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
UpdateWindow
(WinDef.HWND
Handle to the window to be updated.
hWnd
)

The UpdateWindow function updates the client area of the specified window by sending a WM_PAINT message to the window if the window's update region is not empty.

public short

Returns:

If the function succeeds, the low-order byte of the return value contains the virtual-key code and the high-order byte contains the shift state, which can be a combination of the following flag bits.
1
Either SHIFT key is pressed. Use WinUser#MODIFIER_SHIFT_MASK.
2
Either CTRL key is pressed. Use WinUser#MODIFIER_CTRL_MASK.
4
Either ALT key is pressed. Use WinUser#MODIFIER_ALT_MASK.
8
The Hankaku key is pressed. Use WinUser#MODIFIER_HANKAKU_MASK.
16
Reserved (defined by the keyboard layout driver). Use WinUser#MODIFIER_RESERVED1_MASK.
32
Reserved (defined by the keyboard layout driver). Use WinUser#MODIFIER_RESERVED2_MASK.
If the function finds no key that translates to the passed character code, both the low-order and high-order bytes contain -1.
VkKeyScanExA
(byte
The character to be translated into a virtual-key code.
ch
,
WinDef.HKL
Input locale identifier to use for translating the specified code. This parameter can be any input locale identifier previously returned by the #LoadKeyboardLayout() function.
dwhkl
)

Translates a character to the corresponding virtual-key code and shift state.

public short

Returns:

If the function succeeds, the low-order byte of the return value contains the virtual-key code and the high-order byte contains the shift state, which can be a combination of the following flag bits.
1
Either SHIFT key is pressed. Use WinUser#MODIFIER_SHIFT_MASK.
2
Either CTRL key is pressed. Use WinUser#MODIFIER_CTRL_MASK.
4
Either ALT key is pressed. Use WinUser#MODIFIER_ALT_MASK.
8
The Hankaku key is pressed. Use WinUser#MODIFIER_HANKAKU_MASK.
16
Reserved (defined by the keyboard layout driver). Use WinUser#MODIFIER_RESERVED1_MASK.
32
Reserved (defined by the keyboard layout driver). Use WinUser#MODIFIER_RESERVED2_MASK.
If the function finds no key that translates to the passed character code, both the low-order and high-order bytes contain -1.
VkKeyScanExW
(char
The character to be translated into a virtual-key code.
ch
,
WinDef.HKL
Input locale identifier to use for translating the specified code. This parameter can be any input locale identifier previously returned by the #LoadKeyboardLayout() function.
dwhkl
)

Translates a character to the corresponding virtual-key code and shift state.

public WinDef.DWORD

Returns:

The following table shows the possible return values for this function.
Possible return values
Return code/value Description
0 The wait was satisfied successfully.
WAIT_TIMEOUT The wait was terminated because the time-out interval elapsed.
WAIT_FAILED An error occurred.
WaitForInputIdle
(WinNT.HANDLE
A handle to the process. If this process is a console application or does not have a message queue, WaitForInputIdle returns immediately.
hProcess
,
WinDef.DWORD
The time-out interval, in milliseconds. If dwMilliseconds is INFINITE, the function does not return until the process is idle.
dwMilliseconds
)

Waits until the specified process has finished processing its initial input and is waiting for user input with no input pending, or until the time-out interval has elapsed.