News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Any source for just a goasm dialog?

Started by travism, May 13, 2009, 01:04:50 PM

Previous topic - Next topic

travism

So im trying to switch over to goasm, but things ive been able to do with masm it seems is alot different in goasm? I use dialog's alot and I just tried making a basic dialog but it doesnt show? Im probably doing something wrong.. Is there source anywhere for just showing a dialog from a rc file? I would post my source but its on another computer, atm Im reading the goasm tutorials and stuff :\ Thanks!

Edit: On a side note is it kind of stupid for me to switch over right now? even though im doing fine in masm? But theres just a part of me that wants to use goasm for assembly work. :\

hutch--

Edgar can probable help you but you should be able to do the same thing as you can do in MASM as long as you learn the notation and syntax. Just make sure you are performing the API calls correctly and returning the right values in the dialog message handler.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

travism

Yeah thats the problem Im having right now, I like the syntax its just getting used to the different variations. I found an example by vortex (I wish that would have came up in the search). I shall keep reading the manual. Thanks again! :)

Mark Jones

#3
Just a note, that RadASM + GoASM make a nice pair. If you use RadASM's Dialog builder, it will make the .RC files for you from a graphical editor. Then, it is only a matter of calling CreateDialogBoxParam to show the dialog. Somewhere, Donkey made a newer GoASM package for RadASM, and it includes most standard program templates (including dialog-as-main types.)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Vortex

Hi travism,

Here are two GoAsm dialog samples for you.

[attachment deleted by admin]

travism

Thanks vortex, exactly what I was looking for!  :bg

travism

I didn't want to make a new thread just for this next question since I can't find it on the forums. I use LoadIcon to load the icon for the main application but when you run the application it doesnt show a small version of the icon in the titlebar even though the icon has all sizes embedded in it.? Is there a different function or what? Is it because Im using a dialog box? It bugs the crap out of me. :\

MichaelW

One way would be to use SetClassLong passing GCL_HICON in the nIndex parameter and the handle of the icon in the dwNewLong parameter.
eschew obfuscation

Tedd

In processing WM_INITDIALOG:

invoke LoadIcon, hInstance,IDI_ICON
invoke SendMessage, hwnd,WM_SETICON,ICON_BIG,eax

The small one is also set automatically; though you can set ICON_SMALL explicitly too.
No snowflake in an avalanche feels responsible.

Mark Jones

There are about a zillion possible combinations between WinMain / Dialog Resources / DLGTEMPLATEEX / Dialog-As-Main / Subclassed, and the various methods capable of utilizing them (i.e. CreateDialog, CreateDialogIndirect, CreateDialogParam, CreateDialogIndirectParam, CreateWindow, CreateWindowEx, DialogBoxParam, DialogBoxIndirectParam, ... ... ...)

Iczelion doesn't even touch on the intricacies of these, and is a constant source of frustration for some of us. There are subtle differences between each, and often one starts a project in an innocuous manner, then finds they need to do something which is not possible or difficult given the current window method. Converting between them is a grey, uncharted area, where little help resides and OllyDbg is your only life-raft.

For instance, I've spent the last three days trying to get two projects to use different window "classes" (and still don't have the tab-control working, because a dialog-as-main project (utilizing a class) does not seem to expose the ControlID of child controls (so invoke SendMessage,[hTab],TCM_GETCURSEL,0,0 can't find the control...) Of course, I could make this a "DialogBoxParam" but then I loose the classing and WndProc. :snooty:

There needs to be a one-page overview of what works with each window API, and what doesn't. That way, when creating a new project, one could just glance at this and say "Oh, if I want to add a tab control later, looks like I should make the project a _____ type and use _____."

P.S. Here's a source for a nice little "GoAsm dialog" near the bottom of the thread:
http://www.masm32.com/board/index.php?topic=7068.0
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Tedd

Not wanting to take this thread completely off-topic, but...

Quote from: Mark Jones on May 15, 2009, 03:28:49 PM
I've spent the last three days trying to get two projects to use different window "classes" (and still don't have the tab-control working, because a dialog-as-main project (utilizing a class) does not seem to expose the ControlID of child controls (so invoke SendMessage,[hTab],TCM_GETCURSEL,0,0 can't find the control...) Of course, I could make this a "DialogBoxParam" but then I loose the classing and WndProc. :snooty:
SendDlgItemMessage?
I don't think I've ever hand any problems doing this.
No snowflake in an avalanche feels responsible.


Mark Jones

Ever, Tedd? :bg

This is ancillary to the OP's question, so I feel still on-topic. The point is that the differences in the various types of dialog is a grey area. For example, how do you know that SendDlgItemMessage will work for a DialogBoxParam but not a CreateDialogParam?
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

MichaelW

QuoteFor example, how do you know that SendDlgItemMessage will work for a DialogBoxParam but not a CreateDialogParam?

SendDlgItemMessage will work for either. While the PSDK documentation does not specifically state this, it does link to a modeless dialog example that uses the function.
eschew obfuscation