کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

GWL_USERDATA/GWL_ID



hIcon2=CreateWindow('Static', nil, WS_VISIBLE or WS_CHILD or SS_ICON or WS_CLIPSIBLINGS, 507,2,3,120,hForm1,0,hInstance,nil)

I put WS_CLIPSIBLINGS in these 2 Icons to prevent them from drawing on each other, remove the WS_CLIPSIBLINGS and resize the form making it wider or narrow and see what the Icons do} 

SendMessage(hIcon2, STM_SETIMAGE, IMAGE_ICON,LoadIcon(0,IDI_QUESTION)); 
to put a NON-Resource Icon in a Static Icon you SendMessage,STM_SETIMAGE} 


hIcon3=CreateWindow('Static', '', WS_VISIBLE or WS_CHILD or SS_ICON or WS_CLIPSIBLINGS,475,2,7,11,hForm1,0,hInstance,nil) 

SendMessage(hIcon3,STM_SETIMAGE,IMAGE_ICON,LoadIcon(0,IDI_QUESTION))

hLabel2=CreateWindow('Static', 'Enter the Folder you want to list the File Names for below', WS_VISIBLE or WS_CHILD or SS_LEFT,10,40,290,16,hForm1,0,hInstance,nil)

SendMessage(hLabel2,WM_SETFONT,Font1,0)

if possible leave some extra room on controls, width and heigth, in case the font mapper picks a different font than the one you named}

hExitBut=CreateWindow('Button','Exit', WS_VISIBLE or WS_CHILD or BS_PUSHBUTTON or BS_TEXT or BS_BOTTOM or WS_TABSTOP, 285, 108, 64, 28, hForm1, 0, hInstance,nil)

SendMessage(hExitBut, WM_SETFONT, GetStockObject(SYSTEM_FIXED_FONT),0)

because the IsDialogMessage( ) is in the GetMessage loop below, you can put WS_TABSTOP in a control's style to have that control be a Tab Stop. Tab Stop Order is set by the creation order of the Tab Stop controls Since this is the first control with a WS_TABSTOP it is FIRST in the Tab Stop Order, hEdit1 will be next}


SetWindowLong(hExitBut, GWL_USERDATA, 1)

Every window has 4 bytes (integer) of "User Data", which you can set and read with SetWindowLong and GetWindowLong, you might think of this user data integer like the "Tag" property of controls in the VCL. Here I will use the Exit buttons user data as a boolean to signify if the button is visible, see the ChangeStyle procedure above


SetWindowLong(hExitBut, GWL_ID, ID_ExitBut)

control ID numbers are sometimes used in system messages, like the WM_DRAWITEM message, ID can also be used in the WM_COMMAND. . Normaly you would just put this ID number in the hMenu parameter of the CreateWindow function, I do this here to show methods for the SetWindowLong



WS_CLIPSIBLINGS 
0x04000000L