Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Asm in windows

hinjohinjo Member Posts: 35
Can somebody please help me with some programming in windows


push offset lpIconName ;="IDI_APPLICATION",0
push 0
call LoadIcon

this returns 0
WHYYYYYY?

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Can somebody please help me with some programming in windows
    :
    :
    : push offset lpIconName ;="IDI_APPLICATION",0
    : push 0
    : call LoadIcon
    :
    : this returns 0
    : WHYYYYYY?
    :
    [blue]Because, IDI_APPLICATION is not a string, but predefined value. Search for 'IDI_APPLICATION' in "win*.h" and you will see that it is some negative value. Push it instead of the offset to "IDI_APPLICATION" and you are done. In fact, if you have full MASM32 package - you will have this identifier defined in some include file, so you just go:

    push IDI_APPLICATION
    push 0
    call LoadIcon[/blue]
  • hinjohinjo Member Posts: 35
    : : Can somebody please help me with some programming in windows
    : :
    : :
    : : push offset lpIconName ;="IDI_APPLICATION",0
    : : push 0
    : : call LoadIcon
    : :
    : : this returns 0
    : : WHYYYYYY?
    : :
    : [blue]Because, IDI_APPLICATION is not a string, but predefined value. Search for 'IDI_APPLICATION' in "win*.h" and you will see that it is some negative value. Push it instead of the offset to "IDI_APPLICATION" and you are done. In fact, if you have full MASM32 package - you will have this identifier defined in some include file, so you just go:
    :
    : push IDI_APPLICATION
    : push 0
    : call LoadIcon[/blue]
    :

    Thanks man somewhere along the way I got convinced that you should use string instead of values bu I guess not.
    But my problem is not solved yet. Do you mean win(whatever).h cause I can't find any files that contain that kind of info. By the way, I use Tasm, so I don't think I can do like you did in the example.
  • AsmGuru62AsmGuru62 Member Posts: 6,519
    [b][red]This message was edited by AsmGuru62 at 2002-9-24 6:41:4[/red][/b][hr]
    : : : Can somebody please help me with some programming in windows
    : : :
    : : :
    : : : push offset lpIconName ;="IDI_APPLICATION",0
    : : : push 0
    : : : call LoadIcon
    : : :
    : : : this returns 0
    : : : WHYYYYYY?
    : : :
    : : [blue]Because, IDI_APPLICATION is not a string, but predefined value. Search for 'IDI_APPLICATION' in "win*.h" and you will see that it is some negative value. Push it instead of the offset to "IDI_APPLICATION" and you are done. In fact, if you have full MASM32 package - you will have this identifier defined in some include file, so you just go:
    : :
    : : push IDI_APPLICATION
    : : push 0
    : : call LoadIcon[/blue]
    : :
    :
    : Thanks man somewhere along the way I got convinced that you should use string instead of values bu I guess not.
    : But my problem is not solved yet. Do you mean win(whatever).h cause I can't find any files that contain that kind of info. By the way, I use Tasm, so I don't think I can do like you did in the example.
    :
    [blue]These are standard resource IDs:
    [code]
    // Icons:
    [b]#define[/b] IDI_APPLICATION 32512
    [b]#define[/b] IDI_HAND 32513
    [b]#define[/b] IDI_QUESTION 32514
    [b]#define[/b] IDI_EXCLAMATION 32515
    [b]#define[/b] IDI_ASTERISK 32516
    [b]#define[/b] IDI_WINLOGO 32517

    // Cursors:
    [b]#define[/b] IDC_ARROW 32512
    [b]#define[/b] IDC_IBEAM 32513
    [b]#define[/b] IDC_WAIT 32514
    [b]#define[/b] IDC_CROSS 32515
    [b]#define[/b] IDC_UPARROW 32516
    [b]#define[/b] IDC_SIZENWSE 32642
    [b]#define[/b] IDC_SIZENESW 32643
    [b]#define[/b] IDC_SIZEWE 32644
    [b]#define[/b] IDC_SIZENS 32645
    [b]#define[/b] IDC_SIZEALL 32646
    [b]#define[/b] IDC_NO 32648
    [b]#define[/b] IDC_HAND 32649
    [b]#define[/b] IDC_APPSTARTING 32650
    [b]#define[/b] IDC_HELP 32651
    [/code][blue]So, just push the number:

    PUSH 32649 ; IDC_HAND - cursor with a hand pointer...

    Also, download TASM5Plus from 'http://www.wasm.ru/toollist.php?list=7' - it contains all includes you need for Win32 coding.[/blue]


  • hinjohinjo Member Posts: 35
    : [b][red]This message was edited by AsmGuru62 at 2002-9-24 6:41:4[/red][/b][hr]
    : : : : Can somebody please help me with some programming in windows
    : : : :
    : : : :
    : : : : push offset lpIconName ;="IDI_APPLICATION",0
    : : : : push 0
    : : : : call LoadIcon
    : : : :
    : : : : this returns 0
    : : : : WHYYYYYY?
    : : : :
    : : : [blue]Because, IDI_APPLICATION is not a string, but predefined value. Search for 'IDI_APPLICATION' in "win*.h" and you will see that it is some negative value. Push it instead of the offset to "IDI_APPLICATION" and you are done. In fact, if you have full MASM32 package - you will have this identifier defined in some include file, so you just go:
    : : :
    : : : push IDI_APPLICATION
    : : : push 0
    : : : call LoadIcon[/blue]
    : : :
    : :
    : : Thanks man somewhere along the way I got convinced that you should use string instead of values bu I guess not.
    : : But my problem is not solved yet. Do you mean win(whatever).h cause I can't find any files that contain that kind of info. By the way, I use Tasm, so I don't think I can do like you did in the example.
    : :
    : [blue]These are standard resource IDs:
    : [code]
    : // Icons:
    : [b]#define[/b] IDI_APPLICATION 32512
    : [b]#define[/b] IDI_HAND 32513
    : [b]#define[/b] IDI_QUESTION 32514
    : [b]#define[/b] IDI_EXCLAMATION 32515
    : [b]#define[/b] IDI_ASTERISK 32516
    : [b]#define[/b] IDI_WINLOGO 32517
    :
    : // Cursors:
    : [b]#define[/b] IDC_ARROW 32512
    : [b]#define[/b] IDC_IBEAM 32513
    : [b]#define[/b] IDC_WAIT 32514
    : [b]#define[/b] IDC_CROSS 32515
    : [b]#define[/b] IDC_UPARROW 32516
    : [b]#define[/b] IDC_SIZENWSE 32642
    : [b]#define[/b] IDC_SIZENESW 32643
    : [b]#define[/b] IDC_SIZEWE 32644
    : [b]#define[/b] IDC_SIZENS 32645
    : [b]#define[/b] IDC_SIZEALL 32646
    : [b]#define[/b] IDC_NO 32648
    : [b]#define[/b] IDC_HAND 32649
    : [b]#define[/b] IDC_APPSTARTING 32650
    : [b]#define[/b] IDC_HELP 32651
    : [/code][blue]So, just push the number:
    :
    : PUSH 32649 ; IDC_HAND - cursor with a hand pointer...
    :
    : Also, download TASM5Plus from 'http://www.wasm.ru/toollist.php?list=7' - it contains all includes you need for Win32 coding.[/blue]
    :
    :
    :
    Thanks dude, I really appreciate it.
Sign In or Register to comment.