$VersionInfo:Comments
=This uses Controls!
'Creates flat controls remove for 3D ' A Simple Window for QB64 32 & 64 bit
' window_controls_7.bas
' MPG 30-9-2021
'
'---------------------------------------------------------------
'NOTE:
'Create a new file WIN.h with the following content (Remove the comments '):
'---Start of file contents:---
'ptrszint FUNC_WINDOWPROC(ptrszint*_FUNC_WINDOWPROC_OFFSET_HWND,uint32*_FUNC_WINDOWPROC_ULONG_UMSG,uptrszint*_FUNC_WINDOWPROC_UOFFSET_WPARAM,ptrszint*_FUNC_WINDOWPROC_OFFSET_LPARAM);
'LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
' return FUNC_WINDOWPROC((ptrszint *) (& hwnd), & uMsg, & wParam, (ptrszint *) (& lParam));
'}
'void * GetWindowProc() {
' return (void *) WindowProc;
'}
'---End of file contents---
'Your program uses the WIN.h file to get the WindowProc. Note: Place above file in your working folder (The QB64 folder).
'----------------------------------------------------------------
'--Constants
Const WS_EX_CLIENTEDGE
= &H00000200 Const WS_CAPTION
= &H00C00000 Const WS_SYSMENU
= &H00080000 Const WS_THICKFRAME
= &H00040000 Const WS_MINIMIZEBOX
= &H00020000 Const WS_MAXIMIZEBOX
= &H00010000 Const WS_VSCROLL
= &H00200000 Const WS_HSCROLL
= &H00100000 'Const WS_OVERLAPPEDWINDOW = WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
Const WS_OVERLAPPEDWINDOW
= WS_OVERLAPPED
Or WS_CAPTION
Or WS_SYSMENU
Const WS_TABSTOP
= &H00010000 Const WS_VISIBLE
= &H10000000 Const WS_CHILD
= &H40000000 Const WS_GROUP
= &H00020000
Const CW_USEDEFAULT
= &H80000000
Const WM_COMMAND
= &H0111 Const WM_SETTEXT
= &H000C Const WM_GETTEXT
= &H000D
Const SW_SHOWDEFAULT
= &HA
Const BS_PUSHBUTTON
= 0 ' Standard button Const BS_AUTOCHECKBOX
= 3 ' Multi-Checkbox button Const BS_RADIOBUTTON
= 4 ' Single Radio button Const BS_AUTORADIOBUTTON
= 9 ' Multi-radio buttons Const BS_GROUPBOX
= 7 ' Group box "eye candy"
Const EM_SETPASSWORDCHAR
= &HCC
Const ES_PASSWORD
= &H0020
Const ES_AUTOVSCROLL
= &H0040 Const ES_AUTOHSCROLL
= &H0080 Const ES_WANTRETURN
= &H1000
'--Types
As Long cbClsExtra
, cbWndExtra
As _Offset hInstance
, hIcon
, hCursor
, hbrBackground
, lpszMenuName
, lpszClassName
'--Libaries
Function CreateWindowExA%&
(ByVal dwExStyle
As Long, Byval lpClassName
As _Offset, Byval lpWindowName
As _Offset, Byval dwStyle
As Long, Byval X
As Long, Byval Y
As Long, Byval nWidth
As Long, Byval nHeight
As Long, Byval hWndParent
As _Offset, Byval hMenu
As _Offset, Byval hInstance
As _Offset, Byval lpParam
As _Offset)
'--Variables
Dim Shared wc
As WNDCLASSA
' define wc as WNDCLASSEX structure
MainClassName
= "main" + Chr$(0)
CrLf
= Chr$(13) + Chr$(10) 'carriage return&line feed
className
= "myWindowClass" + Chr$(0) 'Used in wc. which in turn is used to register window class with the system.
hi = GetModuleHandleW(0) 'Handle to application instance
'---Step 1: Registering the Window Class
'Fill out the members of WNDCLASSEX structure (wc) and call RegisterClassA
wc.style = 0 ' Class Styles (CS_*), not Window Styles (WS_*) This is usually be set to 0.
wc.lpfnWndProc = GetWindowProc ' Pointer to the window procedure for this window class. (see WIN.h)
wc.cbClsExtra = 0 ' Amount of extra data allocated for this class in memory. Usually 0.
wc.cbWndExtra = 0 ' Amount of extra data allocated in memory per window of this type. Usually 0.
wc.hInstance = hi ' Handle to application instance .
wc.hIcon = 0 ' Large (usually 32x32) icon shown when the user presses Alt+Tab. Set to 0
wc.hCursor = LoadCursorW(0, IDC_ARROW) ' Cursor that will be displayed over our window.
wc.hbrBackground = COLOR_WINDOW 'was +1 Background Brush to set the color of our window. '
wc.lpszMenuName = 0 ' Name of a menu resource to use for the windows with this class.
wc.lpszClassName
= _Offset(className
) ' Name to identify the class with.
Print "RegisterClassA failed:"; GetLastError
'Else Print "OK"
'--Step 2: Creating the Windows
'--Main window
'After registering the class, create a window with it using CreateWindowExA.
'HWND CreateWindowExA(
' DWORD dwExStyle, 0 Extended windows style. Not used set to 0
' LPCSTR lpClassName, _Offset(className) Tells the system what kind of window to create.
' LPCSTR lpWindowName, _Offset(t1) Text displayed in the Caption or Title Bar.
' DWORD dwStyle, WS_OVERLAPPEDWINDOW... Window Style parameters see constants
' int X, CW_USEDEFAULT Top left corner of your window. Let windows choose
' int Y, CW_USEDEFAULT Top left corner of your window. Let windows choose
' int nWidth, 432 Width and
' int nHeight, 400 height of the window
' HWND hWndParent, 0 No parent window set handle to 0
' HMENU hMenu, 0 Not menu set to 0
' HINSTANCE hInstance, hi Module instance handle associated with the window.
' LPVOID lpParam 0 Used with MDI child window not used set to 0
')
t1
= "Window Ref 1" + Chr$(0)'hw = CreateWindowExA(0, _Offset(className), _Offset(t1), WS_HSCROLL Or WS_OVERLAPPEDWINDOW Or WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, 432, 400, 0, 0, hi, 0): If 0 = hw Then System
hw
= CreateWindowExA
(0, _Offset(className
), _Offset(t1
), WS_OVERLAPPEDWINDOW
, CW_USEDEFAULT
, CW_USEDEFAULT
, 432, 520, 0, 0, hi
, 0):
If 0 = hw
Then System
'--Standard Controls: Button, Edit, List Box etc
'Controls are just child windows. They have a procedure, a class etc... that is registered by the system.
'Anything you can do with a normal window you can do with a control.
'-Standard Buttons require style BS_PUSHBUTTON
t0
= "BUTTON" + Chr$(0) ' Set: Window control is BUTTON predefined classt1
= "Button 0" + Chr$(0) 'Set: Button display texthwb0
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or BS_PUSHBUTTON
, 10, 10, 75, 23, hw
, 0, hi
, 0):
If 0 = hwb0
Then System
t0
= "BUTTON" + Chr$(0) ' Set: Window control is BUTTON predefined classt1
= "Button 1" + Chr$(0) 'Set: Button display texthwb1
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or BS_PUSHBUTTON
, 10, 37, 75, 23, hw
, 0, hi
, 0):
If 0 = hwb1
Then System
t0
= "BUTTON" + Chr$(0) ' Set: Window control is BUTTONt1
= "Button 2" + Chr$(0) 'Set: Button display texthwb2
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or BS_PUSHBUTTON
, 10, 64, 75, 23, hw
, 0, hi
, 0):
If 0 = hwb2
Then System
'-Checkbox Buttons require style BS_AUTOCHECKBOX
t0
= "BUTTON" + Chr$(0) ' Set: Window control is BUTTONt1
= "ChkBox0" + Chr$(0) 'Check box label display texthwcb0
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or BS_AUTOCHECKBOX
, 10, 91, 90, 23, hw
, 0, hi
, 0):
If 0 = hwcb0
Then System
t0
= "BUTTON" + Chr$(0) ' Set: Window control is BUTTONt1
= "ChkBox1" + Chr$(0) 'Check box label display texthwcb1
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or BS_AUTOCHECKBOX
, 10, 118, 90, 23, hw
, 0, hi
, 0):
If 0 = hwcb1
Then System
t0
= "BUTTON" + Chr$(0) ' Set: Window control is BUTTONt1
= "ChkBox2" + Chr$(0) 'Check box label display texthwcb2
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or BS_AUTOCHECKBOX
, 10, 145, 90, 23, hw
, 0, hi
, 0):
If 0 = hwcb2
Then System
'Standard Radio Buttons require style BS_RADIOBUTTON (single) or BS_AUTORADIOBUTTON (group)
'First button of a group must have following styles WS_TABSTOP WS_GROUP
'The first control after last group must have style WS_GROUP to terminate last group
'Note: A BS_GROUPBOX is "eye candy" and does not contribute to a radio box group.
' The crucial parameter to control radio or check box grouping is the style WS_GROUP
'--Bank 1: Group box1
t0
= "BUTTON" + Chr$(0) 'predefined classt1
= "Group box1" + Chr$(0)hwgb1
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_GROUPBOX
, 100, 10, 300, 50, hw
, 0, hi
, 0):
If 0 = hwgb1
Then Systemt1
= "Radio 11" + Chr$(0)hwr11
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_AUTORADIOBUTTON
Or WS_TABSTOP
Or WS_GROUP
, 105, 30, 90, 23, hw
, 0, hi
, 0):
If 0 = hwr11
Then Systemt1
= "Radio 12" + Chr$(0)hwr12
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_AUTORADIOBUTTON
, 200, 30, 90, 23, hw
, 0, hi
, 0):
If 0 = hwr12
Then Systemt1
= "Radio 12" + Chr$(0)hwr13
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_AUTORADIOBUTTON
, 300, 30, 90, 23, hw
, 0, hi
, 0):
If 0 = hwr13
Then System
'--Bank 2: Group box2
t0
= "BUTTON" + Chr$(0) 'predefined classt1
= "Group box2" + Chr$(0)hwgb2
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_GROUPBOX
, 100, 70, 300, 50, hw
, 0, hi
, 0):
If 0 = hwgb2
Then Systemt1
= "Radio 21" + Chr$(0)hwr21
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_AUTORADIOBUTTON
Or WS_TABSTOP
Or WS_GROUP
, 105, 90, 90, 23, hw
, 0, hi
, 0):
If 0 = hwr21
Then Systemt1
= "Radio 22" + Chr$(0)hwr22
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_AUTORADIOBUTTON
, 200, 90, 90, 23, hw
, 0, hi
, 0):
If 0 = hwr22
Then Systemt1
= "Radio 23" + Chr$(0)hwr23
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
Or BS_AUTORADIOBUTTON
, 300, 90, 90, 23, hw
, 0, hi
, 0):
If 0 = hwr23
Then System
'--Label1
t0
= "STATIC" + Chr$(0) 'predefined classt1
= "Label1 Enter your score:" + Chr$(0)hwLabel1
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
, 100, 125, 372, 16, hw
, 0, hi
, 0):
If 0 = hwLabel1
Then System
'--Label2
t0
= "STATIC" + Chr$(0) 'predefined classt1
= "Label2 Enter your name:" + Chr$(0)hwLabel2
= CreateWindowExA
(0, _Offset(t0
), _Offset(t1
), WS_VISIBLE
Or WS_CHILD
, 100, 142, 372, 16, hw
, 0, hi
, 0):
If 0 = hwLabel2
Then System
'--Edit single line
t0
= "EDIT" + Chr$(0) 'predefined classt1
= "This is a edit control." + Chr$(0)hwe1
= CreateWindowExA
(WS_EX_CLIENTEDGE
, _Offset(t0
), _Offset(t1
), WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or ES_LEFT
, 12, 175, 372, 26, hw
, 0, hi
, 0):
If 0 = hwe1
Then System
'---Edit multiline control
t0
= "EDIT" + Chr$(0) 'predefined classt1
= "This is a" + CrLf
+ "multiline edit control." + CrLf
+ "Click in me and type." + CrLf
+ "It should scroll automatically in both directions, but there aren't any scroll bars." + CrLf
+ "Close the window to see the text printed to the console." + Chr$(0)hwe2
= CreateWindowExA
(WS_EX_CLIENTEDGE
, _Offset(t0
), _Offset(t1
), WS_VSCROLL
Or WS_HSCROLL
Or WS_TABSTOP
Or WS_VISIBLE
Or WS_CHILD
Or ES_AUTOHSCROLL
Or ES_AUTOVSCROLL
Or ES_LEFT
Or ES_MULTILINE
Or ES_WANTRETURN
, 10, 210, 400, 120, hw
, 0, hi
, 0):
If 0 = hwe2
Then System
'---List box control
t0
= "LISTBOX" + Chr$(0) 'predefined classhwLB
= CreateWindowExA
(WS_EX_CLIENTEDGE
, _Offset(t0
), 0, WS_CHILD
Or WS_VISIBLE
Or LBS_NOTIFY
Or WS_VSCROLL
Or ES_AUTOVSCROLL
, 10, 340, 150, 120, hw
, 0, hi
, 0):
If 0 = hwLB
Then System
'---Combo drop-down List control
Const CBS_READONLY
= &H1000 'Remove to edit selection Const CBS_NOTIFY
= &H0008 Const CBS_DROPDOWNLIST
= 3 t0
= "COMBOBOX" + Chr$(0) 'predefined classhwCB
= CreateWindowExA
(WS_EX_CLIENTEDGE
, _Offset(t0
), 0, WS_CHILD
Or WS_VISIBLE
Or CBS_DROPDOWNLIST
Or CBS_READONLY
, 170, 340, 150, 110, hw
, 0, hi
, 0):
If 0 = hwCB
Then System
'--hwCB Add items to combo box
t0
= "Combo box Item" + Str$(j
) + Chr$(0) discardp
= SendMessageA
(hwCB
, CB_ADDSTRING
, 0, _Offset(t0
)) ' Add text'--End hwCB Add items to combo box
'--hwCB Initialize combo control default selection. Note -1 no selection
CB_selected_item = 7 'set initial selection value
'Zero index. Note index 2 selects the third element
Const CB_SETCURSEL
= 334 'Set selection discardp = SendMessageA(hwCB, CB_SETCURSEL, CB_selected_item, 0)
'discardp = SendMessageA(hwCB, CB_SETCURSEL, -1, 0) 'No selection
'---End combo control
'--hwLB Add items to list box
Const LB_ADDSTRING
= &H180 t0
= "List Box Item" + Str$(i
) + Chr$(0) discardp
= SendMessageA
(hwLB
, LB_ADDSTRING
, 0, _Offset(t0
)) ' Add text'--End hwLB Add items to list box
'--hwLB Initialize list control default selection. Note -1 no selection
'Zero index. Note index 2 selects the third element
Const LB_SETCURSEL
= &H186 'Set selection LB_selected_item = 8 'set initial selection value
discardp = SendMessageA(hwLB, LB_SETCURSEL, LB_selected_item, 0)
'discardp = SendMessageA(hwLB, LB_SETCURSEL, -1, 0) 'No selection
'---End list control
'--Initialize set initial conditions
discardp = SendMessageA(hwcb1, BM_SETCHECK, BST_CHECKED, 0) 'Set check box
discardp = SendMessageA(hwr13, BM_SETCHECK, BST_CHECKED, 0) 'Set radio button
discardp = SendMessageA(hwr23, BM_SETCHECK, BST_CHECKED, 0) 'Set radio button
t0
= "CLOSE" + Chr$(0) ' Text to send to buttton Button2'discardp = SetWindowTextA&(hwb2, _Offset(t0)) ' Method 1 Change button text from Button2 to Close
discardp
= SendMessageA
(hwb2
, WM_SETTEXT
, 0, _Offset(t0
)) ' Method 2 Alternative
t0
= "Label2 text changed ?" + Chr$(0) ' Text to send to Label2'discardp = SetWindowTextA&(hwLabel2, _Offset(t0)) ' Method 1
discardp
= SendMessageA
(hwLabel2
, WM_SETTEXT
, 0, _Offset(t0
)) ' Method 2 Alternative
t0
= "Edit control:" + Chr$(0) ' Text to send to Edit control'discardp = SetWindowTextA&(hwe1, _Offset(t0)) ' Method 1
discardp
= SendMessageA
(hwe1
, WM_SETTEXT
, 0, _Offset(t0
)) ' Method 2 Alternative
'discardp = SendMessageA(hwe1, EM_SETPASSWORDCHAR, 0, 0) ' Edit control Remove password character
'discardp = SendMessageA(hwe1, EM_SETPASSWORDCHAR, Asc("*"), 0) ' Edit control Set password character
'Dim Shared winstyle As Long 'current window style variable
Const GWL_STYLE
= -16 'Window style command
'winstyle = GetWindowLongA(hwe1, GWL_STYLE)
'discardp = SetWindowLongA(hwe1, GWL_STYLE, winstyle Or ES_NUMBER) ' Add number style
'winstyle = GetWindowLongA(hwe1, GWL_STYLE)
'discardp = SetWindowLongA(hwe1, GWL_STYLE, winstyle And Not ES_NUMBER) 'Remove number style
'--End Initialize set initial conditions
'----How to set top/bottom margins of a Win32 Edit control "hwe2"
As Long left
, top
, right
, bottom
Const EM_SETRECT
= &H00B3 Print rect.left
, rect.top
, rect.right
, rect.bottom
Print rect.left
, rect.top
, rect.right
, rect.bottom
' Edit control set margin
If SendMessageA
(hwe2
, EM_SETRECT
, 0, _Offset(rect
)) Then ' Edit control set margin
'Display and Update window to ensure it has properly redrawn itself on the screen.
discardb = ShowWindow(hw, SW_SHOWDEFAULT)
discardb = UpdateWindow(hw)
'-- Step 3: The Message Loop
While GetMessageA
(_Offset(msg
), 0, 0, 0) > 0 ' gets a message from your application's message queue. discardb
= TranslateMessage
(_Offset(msg
)) ' performs some additional processing on keyboard events discardp
= DispatchMessageA
(_Offset(msg
)) ' sends the message out to the window that the message was sent to
'####== End program ==###
'-- Step 4: the Window Procedure
' Case WM_CREATE
' WindowProc = 0
discardp
= SendMessageA
(hwe2
, WM_GETTEXT
, Len(buf2
), _Offset(buf2
)) 'Get text
a$
= _Trim$(buf2
) ' Remove spaces a$
= Left$(a$
, InStr(a$
, Chr$(0)) - 1) ' Buffer contains a null terminated string. Find position of null. buf2 = "" ' Extract characters upto this null character. Clear buffer
'----Remove unwanted CRLF---
'-----END remove-------------
Print "Radio 11: 0x";
Hex$(SendMessageA
(hwr11
, BM_GETCHECK
, 0, 0)) Print "Radio 12: 0x";
Hex$(SendMessageA
(hwr12
, BM_GETCHECK
, 0, 0)) If SendMessageA
(hwcb1
, BM_GETCHECK
, 0, 0) = BST_CHECKED
Then
DestroyWindow (hWnd) 'Destroy window and child windows
WindowProc = 0
PostQuitMessage 0 'Want to exit the program
WindowProc = 0
'===============
'---Respond to Listbox selection
Const LB_GETCURSEL
= &H188 ' get index of currently selected item in listbox Const LB_GETTEXT
= &H189 ' get selected item text
Dim selectedIndexLB
As _Offset 'item selected returned as offset Dim textBuffLB
As String * 32 ' Buffer to store selected string
LBwParm = ConvertOffset&&(wParam) ' Convert to long
'listbox hwLB selection changed
If (HIWORD
(LBwParm
) = LBN_SELCHANGE
) And (lParam
= hwLB
) Then selectedIndexLB = SendMessageA(hwLB, LB_GETCURSEL, 0, 0) 'Get current selection
tempLB = ConvertOffset&&(selectedIndexLB) ' convert to long
'--Get item text store in buffer
discardp
= SendMessageA
(hwLB
, LB_GETTEXT
, tempLB
, _Offset(textBuffLB
))
Print "LBzzzzzzz", LBwParm
, HIWORD
(LBwParm
) Print "List box selection = "; tempLB
WindowProc = 0
'---End Respond to Listbox selection
'---Respond to Combo Listbox selection
Const CB_GETCURSEL
= 327 ' get index of currently selected item in combo listbox Const CB_GETLBTEXT
= 328 ' get selected item text
Dim selectedIndexCB
As _Offset 'item selected returned as offset Dim textBuffCB
As String * 32 ' Buffer to store selected string
CBwParm = ConvertOffset&&(wParam) 'Convert to long
'Combo listbox hwCB selection changed
If (HIWORD
(CBwParm
) = CBN_SELCHANGE
) And (lParam
= hwCB
) Then selectedIndexCB = SendMessageA(hwCB, CB_GETCURSEL, 0, 0) 'Get current selection
tempCB = ConvertOffset&&(selectedIndexCB) ' convert to long
'--Get item text store in buffer
discardp
= SendMessageA
(hwCB
, CB_GETLBTEXT
, tempCB
, _Offset(textBuffCB
))
Print "CBxxxxxx", LBwParm
, HIWORD
(LBwParm
) Print "Combo box selection = "; tempCB
WindowProc = 0
'---End Respond to Combo Listbox selection
'=====================
'A button was clicked test each one
'---Three standard buttons---
WindowProc = 0
'Get input text and copy to buffer (1)
discardp
= SendMessageA
(hwe1
, WM_GETTEXT
, Len(buf1
), _Offset(buf1
)) 'Read text from Edit control into buf1 a$
= Left$(buf1
, InStr(buf1
, Chr$(0)) - 1) 'Buffer contains a null terminated string. Find position of null. Print "Button 1 pressed. Text read from edit control: ### " + a$
+ " ###" ' Extract characters upto this null character. buf1 = "" ' Clear buffer
WindowProc = 0
Print "Button 2 pressed Also used as close button" discardp = PostMessageA(hWnd, WM_CLOSE, 0, 0) 'Use a button close Close
WindowProc = 0
'---End standard buttons---
'---Three checkbox standard buttons---
Print "Check box 0 click" If SendMessageA
(hwcb0
, BM_GETCHECK
, 0, 0) = BST_CHECKED
Then Print "Check box 0 is checked:" Print "Check box 0 is un-checked:" WindowProc = 0
Print "Check box 1 click" WindowProc = 0
Print "Check box 2 click" WindowProc = 0
'---End checkbox standard buttons---
'---Bank 1 - Radio buttons---
WindowProc = 0
WindowProc = 0
WindowProc = 0
'---End Bank 1 - Radio buttons---
'---Bank 2 - Radio buttons---
If SendMessageA
(hwr21
, BM_GETCHECK
, 0, 0) = BST_CHECKED
Then WindowProc = 0
WindowProc = 0
'---End Bank 2 - Radio buttons---
'Not our message send back to system for processing
WindowProc = DefWindowProcA(hWnd, uMsg, wParam, lParam)
WindowProc = DefWindowProcA(hWnd, uMsg, wParam, lParam)
'Not our message send back to system for processing
WindowProc = DefWindowProcA(hWnd, uMsg, wParam, lParam)
m
= _Mem(value
) 'Point it to use value 'On 64 bit OSes, an OFFSET is 8 bytes in size. We can put it directly into an Integer64
ConvertOffset = temp
'However, on 32 bit OSes, an OFFSET is only 4 bytes. We need to put it into a LONG variable first
_MemGet m
, m.OFFSET
, temp
'Like this ConvertOffset = temp 'And then assign that long value to ConvertOffset&&
HIWORD = (dw \ 65535) - 1
HIWORD = dw \ 65535
LOWORD
= &H8000 Or (dw
And &H7FFF&
)