Win32 App
SDI
SDI Window
-
stripped from WinAsm Studio
by cao_cong
[*BEGINPRO*]
[*BEGINDEF*]
[MakeDef]
Menu=1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0
1=4,O,$B\RC.EXE /v,1
2=3,O,$B\ML.EXE /c /coff /Cp /nologo /I"$I",2
3=5,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /LIBPATH:"$L" /OUT:"$5",3,4
4=0,0,,5
5=rsrc.obj,O,$B\CVTRES.EXE,rsrc.res
6=*.obj,O,$B\ML.EXE /c /coff /Cp /nologo /I"$I",*.asm
7=0,0,"$E\OllyDbg",5
[MakeFiles]
0=SDI.rap
1=SDI.rc
2=SDI.asm
3=SDI.obj
4=SDI.res
5=SDI.exe
6=SDI.def
7=SDI.dll
8=SDI.txt
9=SDI.lib
10=SDI.mak
11=SDI.hla
12=SDI.com
13=SDI.ocx
14=SDI.idl
15=SDI.tlb
[Resource]
[StringTable]
[Accel]
[VerInf]
[*ENDDEF*]
[*BEGINTXT*]
SDI.Asm
.386

.MODEL FLAT,STDCALL

OPTION CASEMAP:NONE

WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD

Include SDI.inc

.CODE
Start:
	Invoke GetModuleHandle, NULL
	MOV hInstance,EAX
	Invoke GetCommandLine
	MOV CommandLine, EAX
	Invoke WinMain, hInstance, NULL, CommandLine, SW_SHOWDEFAULT
	Invoke ExitProcess,EAX
	
WinMain Proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
Local wc:WNDCLASSEX
Local msg:MSG
Local hwnd:HWND

	MOV wc.cbSize, SizeOf WNDCLASSEX
	MOV wc.style, CS_HREDRAW or CS_VREDRAW
	MOV wc.lpfnWndProc, Offset WndProc
	MOV wc.cbClsExtra,NULL
	MOV wc.cbWndExtra,NULL
	PUSH hInst
	POP wc.hInstance
	MOV wc.hbrBackground, COLOR_WINDOW+1
	MOV wc.lpszMenuName, NULL
	MOV wc.lpszClassName, Offset ClassName
	Invoke LoadIcon, NULL, IDI_APPLICATION
	MOV wc.hIcon,EAX
	MOV wc.hIconSm,0
	Invoke LoadCursor, NULL, IDC_ARROW
	MOV wc.hCursor,EAX
	Invoke RegisterClassEx, addr wc
	Invoke LoadMenu, hInst, Offset MenuName
	MOV hMenu,EAX
	Invoke CreateWindowEx, WS_EX_CLIENTEDGE, ADDR ClassName, ADDR szAppName,\
           WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,\
           CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, hMenu,\
           hInst, NULL
	MOV hwnd,EAX
	Invoke ShowWindow, hwnd, SW_SHOWNORMAL
	Invoke UpdateWindow, hwnd
	.While TRUE
		Invoke GetMessage, ADDR msg, NULL, 0, 0
		.Break .If (!EAX)
		Invoke TranslateMessage, ADDR msg
		Invoke DispatchMessage, ADDR msg
	.EndW
	MOV EAX, msg.wParam
	RET
WinMain endp
WndProc Proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
	.If uMsg==WM_DESTROY
		Invoke PostQuitMessage, NULL
	.ElseIf uMsg==WM_COMMAND
		MOV EAX,wParam
		.If AX==IDM_FILE_NEW
			Invoke MessageBox, NULL, ADDR szFileNew, Offset szAppName, MB_OK
		.ElseIf AX==IDM_FILE_OPEN
			Invoke MessageBox, NULL, ADDR szFileOpen, Offset szAppName, MB_OK
		.ElseIf AX==IDM_HELP_ABOUT
			Invoke MessageBox, NULL,ADDR szHelpAbout, Offset szAppName, MB_OK
		.Else
			Invoke DestroyWindow, hWnd
		.EndIf
	.Else
		Invoke DefWindowProc, hWnd, uMsg, wParam, lParam
		RET
	.EndIf
	XOR EAX,EAX
	RET
WndProc EndP

End Start
[*ENDTXT*]
[*BEGINTXT*]
SDI.Inc
Include windows.inc
Include user32.inc
Include kernel32.inc
;-------------------------------------------------------------------
;Needed For Debug Window Only
;Include masm32.inc
;Include debug.inc
;-------------------------------------------------------------------
IncludeLib user32.lib
IncludeLib kernel32.lib
;-------------------------------------------------------------------
;Needed For Debug Window Only
;IncludeLib masm32.lib
;IncludeLib debug.lib

.DATA
ClassName		DB "MainWinClass",0
szAppName		DB "SDI Application",0
MenuName		DB "FirstMenu",0
szFileNew		DB "You selected 'New'.",0
szFileOpen		DB "You selected 'Open'.",0
szHelpAbout		DB "You selected 'About'.",0

.DATA?
hInstance		HINSTANCE ?
CommandLine		LPSTR ?
hMenu			HMENU ?

.CONST
IDM_FILE_NEW	EQU 1
IDM_FILE_OPEN	EQU 2
IDM_HELP_ABOUT	EQU 3
IDM_FILE_EXIT	EQU 4
[*ENDTXT*]
[*BEGINTXT*]
SDI.Rc
#include "Res/SDIMnu.rc"
[*ENDTXT*]
[*BEGINBIN*]
SDI.mnu
46697273744D656E750000000000000000000000000000000000000000000000
00000000000064000100000000444D5F00000000000000000000000000000000
000000000000000000000000000000002646696C650000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0100000049444D5F46494C455F4E455700000000000000000000000000000000
0000000001000000264E65770000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000010000000000000000000000000000000100000049444D5F
46494C455F4F50454E0000000000000000000000000000000000000002000000
264F70656E000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
010000000000000000000000000000000100000000444D5F0000000000000000
0000000000000000000000000000000000000000000000002D00000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000100000049444D5F46494C455F4558495400000000000000
0000000000000000000000000400000045267869740000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000001000000000000000000000000000000
0100000000444D5F000000000000000000000000000000000000000000000000
00000000000000002648656C7000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000100000049444D5F
48454C505F41424F555400000000000000000000000000000000000003000000
2641626F75740000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
01000000000000000000000000000000
[*ENDBIN*]
[*ENDPRO*]
[*BEGINTXT*]
Res\SDIMnu.Rc
#define IDM_FILE_NEW 1
#define IDM_FILE_OPEN 2
#define IDM_FILE_EXIT 4
#define IDM_HELP_ABOUT 3
FirstMenu MENUEX
BEGIN
  POPUP "&File"
  BEGIN
    MENUITEM "&New",IDM_FILE_NEW
    MENUITEM "&Open",IDM_FILE_OPEN
  END
  POPUP "",,0x00000800
  BEGIN
    MENUITEM "E&xit",IDM_FILE_EXIT
  END
  POPUP "&Help"
  BEGIN
    MENUITEM "&About",IDM_HELP_ABOUT
  END
END
[*ENDTXT*]
