Use masm32 to call the dialog box resources in WinRAR

Source: Internet
Author: User

PurpleendurerOriginal

2005.11.181Version

Note: Use Alt + F4 to disable it.

. 386
. Model flat, stdcall
Option Casemap: None
Include/masm32/include/Windows. inc
Include/masm32/include/kernel32.inc
Include/masm32/include/user32.inc
Includelib/masm32/lib/user32.lib
Includelib/masm32/lib/kernel32.lib

Dlgproc proto: DWORD,: DWORD

. Data
G_szwinrar DB "C:/program files/WinRAR/winrar.exe", 0
G_szdlgcaption DB "getarc", 0

G_szfailloadlibrary DB "loadlibrary", 0

. Data?
G_hrar handle?

. Code
Start:
Invoke loadlibrary, ADDR g_szwinrar
. If eax! = NULL
MoV g_hrar, eax

Invoke dialogboxparam, g_hrar, ADDR g_szdlgcaption, null, ADDR dlgproc, null

Invoke freelibrary, g_hrar

MoV eax, offset g_szdlgcaption
. Else
MoV eax, offset g_szfailloadlibrary
. Endif
Invoke MessageBox, null, eax, eax, null
Invoke exitprocess, null

Dlgproc proc hdlg: hwnd, umsg: uint, wparam: wparam, lparam: lparam
. If umsg = wm_initdialog
Invoke MessageBox, null, offset g_szwinrar, offset g_szwinrar, mb_systemmodal

Invoke getwindowlong, hdlg, gwl_style
Or eax, ws_minimizebox or ws_maximizebox or ws_sysmenu
Invoke setwindowlong, hdlg, gwl_style, eax

. Else
Invoke defwindowproc, hdlg, umsg, wparam, lparam
RET
. Endif
MoV eax, true
RET
Dlgproc endp

End start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.