Hello, After i make a nice Icon to my Programm *g* i like to set the Icon to the Task. Has anyone here a Sample of this function for >Tasm< ? Thanks and cu
Posted on 2001-02-02 16:52:00 by WH¥
here is a sample from out early tests should work with TASM...and MASM

;*****************************************
;	Win Main Setup
;*****************************************
.data
	CommandLine   	dd 0

	szDisplayName 	db "OurGame v0.01",0
	szClassName   	db "SolarClass",0	

	hwndmain        dd 0
	hinstmain       dd 0
	hdc_main	dd	0

	wc   WNDCLASS    
	Wwd  DWORD      800
	Wht  DWORD      600
	Wtx  DWORD      0
	Wty  DWORD      0


	hdc_main_back	dd	0

	lppaint		PAINTSTRUCT	
	msg 		MSGSTRUCT	

;	sz_temporar	db	"999.999.999.999.999.999.999",0,0,0,0

.code

Win_Main_Setup:

;
; Fill WNDCLASSEX structure with required values
; PROBLEM IS we only use a WNDCLASS (no EX sufix)
; strange but it works...
; anyway should check it up when we have time
;===================================================
;	mov	, 		sizeof WNDCLASS
	mov	, 		CS_DBLCLKS

;
; this is the address of the CALLBACK PROCEDURE
; =================================================
	mov	,	offset WndProc		; address of WndProc
;
	mov	,	LARGE 0
	mov	,	LARGE 0

	mov	eax,  	   			; that instance handle
	mov	,eax				; we saved

	mov	,	COLOR_WINDOW+2		; system color
	mov	,	LARGE 0
	mov	,	offset szClassName	; window class name

; *************************************
; application icon
; change this with YOUR ICON WHY!
; you have to define the id and the icon in  the
; resource file
; *************************************
	push	LARGE IDI_APPLICATION		; predefined win app ID we use
	push	LARGE 0
	call	LoadIconA
	mov	,eax
;
; the Cursor
; ===========
;	push	LARGE IDC_ARROW			; predefined cursor  ID
;	push	LARGE 0
;	call	LoadCursorA
	mov	eax,0
	mov	,eax
;
;   	mov	,0		; the small icon?

;=============================
; here we register our class
;=============================
	push    offset wc
	call    RegisterClassA
;
; ==================================
; Create the main application window
; ==================================
        push	LARGE 0			; lparam
        push	
        push	LARGE 0
        push	LARGE 0
        push	
        push	
        push	
        push	

	push	WS_POPUP or WS_CLIPSIBLINGS or WS_MINIMIZE or WS_VISIBLE or WS_SYSMENU 

        push	offset	szDisplayName
        push	offset	szClassName	; we have to use the prev registered class
        push	LARGE 0  
;
;================================================
; should we use CreateWindowA ?
; saddly but it looks like import32.lib we have
; does not include this function.... :(
;=================================================

; ===========================
; here we create the Window
; ===========================
	call	CreateWindowExA
;
	mov	,eax   ; and store return value for safe keeping

;
; looks like we are NOT going to use a menu
; on this window .. at least for now
;========================================================
;	push	LARGE 600	; id meniu?
;	push	
;	call	LoadMenuA	; load resource menu

;	mov	eax,0
;	push	eax
;	push	
;	call	SetMenu		; set it to main window
;========================================================

;===================================
;setting the cursor
;===================================
	push	LARGE IDC_ARROW			; predefined cursor  ID
	push	LARGE 0
	call	LoadCursorA
	push	eax
	call	SetCursor



; show some action on GDI screen
; ================================
        push SW_SHOWNORMAL
        push 
        call ShowWindow      	; show the GDI window
        push 
        call UpdateWindow    	; REFRESH the GDI window

; ====================================================
; The MAIN Window is now vizible in GDI
; but how it looks heavely depend on prev parameters
; ===========================================
Posted on 2001-02-02 18:46:00 by BogdanOntanu
Hello, thanks a lot for helping me again ;) i see the sample is from a game source ,do you code games in asm ? Can i get you URL if you code games ,to see whats possible whit asm ? Because i try the last months to learn delphi. After i see some asm samples,like a irc client with 8kb size ,i stop learning delphi and try to learn asm ;) im ,how to say ,surprised what i can do with asm. first i think only virus coders use today asm ;) but after seeing iczelions tutorials,nice guis,buttons with icons and so....i think i can do what i like to code in asm and there is no neednes of delphi. also i seek some pages for demo coding. i remember some c64 days,where i code some raster bars and like doing this again on my pc ;) thanks for helping me ;) cu ps: you are from india ? because your nickname i think this *g* nice land,some friends of mine stay some months there and next time another friend went to india ;) btw. excuse my bad english.
Posted on 2001-02-03 06:24:00 by WH¥
Hello, NO, I am not Bogdan ;) But I can give an URL to you where to find more information about Hostile Encounter http://www.geocities.com/bogdanontanu/ There you wil find everything about it. Stefan
Posted on 2001-02-03 19:01:00 by Stefan Krause
Hello, thanks for the link. im really surprised from what i see ! first i think of a normal game like scrolling from left to right and shooting aliens *bg* but a strategie game is very cool and i think hard to code. i personal like to play strategie games and after posting i try to download the demo :) the screenshoots looks cool and i think this will be a great game. at this time i really dont know what to say ;) i wish i code asm since years *g* cu
Posted on 2001-02-03 20:13:00 by WH¥