Win32ASM experience

zhaozj2021-02-17  49

Some Experience of Win32ASM # 1: 'Ates (ates@anet.net.tr)

Q1. How to hide / display the taskbar? Q2. How to disable / allow / display / hide the start button? Q3. How to create a real "always on the top" window? Q4. How to create hot keys? Such as Ctrl Alt a Q5. How to get a Windows directory and system directory? Q6. How to open the start menu from my program? Q7. How to close the active program? Q8. How to remove the window title? Q9. How to know if the window is in the task bar (or Visible)? Q10. How to hide a window? Q11. How to put the window in the front desk? Q12. How to block Ctrl Alt Del, Alt Tab Ctrl ESC These keys? Q13. How to determine the automatic hidden features of the Windows taskbar Is it activated? Q14. How to use the default browser or mail program? Q15. How to display the network connection dialog box with Win32 API?

How to hide / display the taskbar?

Shell DB "shell_trayWnd", 0; class name invoke FindWindow, Addr shell, NULL; first get the handle, then hide.. IF Eax! = 0INVoke ShowWindow, Eax, sw_hide; display .Endif with sw_show.

- How to prohibit / allow / display / hide start button?. Data? Buffer DB 127 DUP (?). Datashell DB "shell_traywnd", 0sbar DB "Button, 0Child DD? Slen DD? CodeInvoke FindWindow, AddR shell, NULL; Get the status bar handle MOV TRAY, EAXINVOKE GETWINDOW, TRAY, GW_CHILD; get the child window (if any) Mov Child, Eax.if CHild! = 0invoke getclassname, child, offset buffer, sizeof buffer; get sub-window classes Name .IF EAX> 0INVoke Lstrlen, Offset Buffer; Get Class Name Length Mov Slen, EaxInvoke CharupperBuff, Offset Buffer, Slen; Transformer INVOKE LSTRCMP, ADDR BUFFER, ADDR SBAR; Compare class name with 'Button'. IF EAX = = 0invoke ShowWindow, child, SW_HIDE; hide the start button; invoke ShowWindow, child, SW_SHOW; display the start button; invoke EnableWindow, child, FALSE; prohibit the start button; invoke EnableWindow, child, TRUE; allowing the start button .endif .endif.endif

- How to create a real "always on the top" window?

Invoke SetWindowPos, HWIN, HWND_TOPMOST, NULL, NULL, NULL, NULL, SWP_NOACTIVATE OR SWP_NOMOVE OR SWP_NOSIZE

- How to create a hotkey? For example, Ctrl Alt A

.datahmsg db "HotKey CTRL ALT A Works good!", 0hcap db "Hotkey Example", 0.code.if uMsg == WM_CREATEinvoke RegisterHotKey, hWnd, 065h, MOD_CONTROL or MOD_ALT, 041h; CTRL ALT A (041h is 65 - 065h is 101) .elseif uMsg == WM_HOTKEYinvoke MessageBox, hWin, addr hmsg, addr hcap, MB_OK or MB_ICONINFORMATION.elseif uMsg == WM_DESTROYinvoke UnregisterHotKey, hWin, 065hinvoke PostQuitMessage, NULLreturn 0 .endif- how to obtain the Windows system directory and table of Contents

.databuffer db 50 dup hCap db "WindowsDirectory", 0.codeinvoke GetWindowsDirectory, addr buffer, sizeof buffer (?); Windows home directory in the buffer; invoke GetSystemDirectory, addr buffer, sizeof buffer; set system directory to invoke buffer MessageBox, HWND, AddR Buffer, AddR Hcap, MB_OK or MB_ICONITIONMATION

- How to open the start menu from my program?

Invoke SendMessage, Hwnd, WM_SYSCOMMAND, SC_TASKLIST, NULL

- How to close the active program?

.DATAFWIN DD? CodeInvoke GetForegroundWindowMov Fwin, EaxInvoke SendMessage, Fwin, WM_Close, Null

- How to remove the window title?

Invoke getwindowlong, hwnd, gwl_style; get the current window and Eax, not ws_caption; remove WS_CAPTIONINVOKE SETWINDOWLONG, HWND, GWL_STYLE, EAX; set up window classes

- How do you know if the window is in the taskbar (or visible)?

Invoke iswindowvisible, hwin.if eax == true; window is visible .Else; window is invisible .enDif

- How to hide a window?

? .Datamirc db "mIRC32", 0mhand dd .codeinvoke FindWindow, addr mirc, NULL; looking mIRC32mov mhand, eax .if mhand = 0;! Find invoke ShowWindow, mhand, SW_SHOW;? Display window; invoke ShowWindow, mhand, SW_HIDE; Hidden window. ELSE; mirc32 is not running .... Endif

- How to place the window in the foreground?

Invoke setForegroundWindow, MHAND

- How to block CTRL ALT DEL, ALT TAB CTRL ESC these keys?

Invoke SystemParametersInfo, SPI_Screensaverrunning, 1, Null, Null; Windows98 Only 1 Off 0 Allow

- How do I determine if the automatic hidden feature of the Windows taskbar is activated?

.dataAppBar APPBARDATA {}; {} refers to the use of default values ​​... Thanks to TTom.codemov AppBar.cbSize, sizeof AppBarinvoke SHAppBarMessage, ABM_GETSTATE, addr AppBar; ShellApi command and eax, ABS_AUTOHIDE.if eax == TRUE; taskbar is hidden .ELSE; Taskbar is not hidden. Nendif - How to use the default browser or mail program?

.DATALPPAGE DB "http://win32asm.cjb.net", 0lpmail DB "ATES@anet.net.tr", 0lpoperty DB "Open", 0.CodeInvoke Shellexecute, Hwin, AddR LPOPOPERATION, ADDR LPPAGE, NULL, NULL, SW_SHOWNORMALINVOKE SHELLEXECUTE, HWIN, ADDR LPOPERATION, ADDR LPMAIL, NULL, NULL, SW_SHOWNORMAL

- How to display the network connection dialog box with Win32 API?

INCLUDE /MASM32/INCLUDE /MPR.Includelib /masm32/lib/mpr.libinvoke WnetConnectionDialog, hwnd, resourcetype_disk

转载请注明原文地址:https://www.9cbs.com/read-29673.html

New Post(0)