
Semen - cute demo! Ive saved that to my samples directory, im sure it will come in very handy soon
------------------
#Compile Exe #Register None #Dim All #Include "WIN32API.INC" CallBack Function DlgProc Select Case CbMsg Case %WM_SYSCOMMAND: If LoWrd(CbWparam) = %SC_CLOSE Then Function = 1 Case %WM_COMMAND: If CbCtl = %IDOK Then Dialog End CbHndl End Select End Function Function PbMain Dim hDlg As Long Dialog New hDlg, "Test", , , 100, 100, %WS_OVERLAPPEDWINDOW Or %WS_CAPTION To hdlg Control Add Button, hDlg, %IDOK, "End", 10, 10, 80, 15 DeleteMenu GetSystemMenu(hDlg, 0), %SC_CLOSE, %MF_BYCOMMAND ' Not important Dialog Show Modal hDlg Call DlgProc End Function
#Compile Exe #Register None #Dim All #Include "Win32Api.Inc" %ID_Text = 201 CallBack Function DlgProc Dim nAtom(15) As Static Dword, i As Long Select Case CbMsg Case %WM_INITDIALOG For i = 0 To 15 nAtom(i) = GlobalAddAtom ("My Hotkey" + Str$(i) + Str$(Timer)) RegisterHotKey CbHndl, nAtom(i), i, %VK_SNAPSHOT Next SetTimer CbHndl, 1, 5000, ByVal 0 Case %WM_DESTROY For i = 0 To 15 UnregisterHotKey CbHndl, nAtom(i) GlobalDeleteAtom nAtom(i) Next Case %WM_HOTKEY ' CbWparam = nAtom ShowWindow CbHndl, 1 SetTimer CbHndl, 1, 3000, ByVal 0 Control Set Text CbHndl, %ID_TEXT, "x-PrtSc pressed at " + Time$ Case %WM_TIMER KillTimer CbHndl, 1: ShowWindow CbHndl, 0 End Select End Function Function PbMain Local hDlg As Long Dialog New 0, "HotKey (Print Screen)",,, 300, 40, %WS_SYSMENU, _ %WS_EX_TOPMOST Or %WS_EX_TOOLWINDOW To hDlg Control Add Label, hDlg, %ID_Text, "Press Print Screen in another apps or Close this dialog", _ 5, 10, 290, 15, %SS_CENTER Dialog Show Modal hDlg Call DlgProc End Function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: