flat assembler
Message board for the users of flat assembler.
Index
> Windows > [solved]Resource Editor needed (RC or Res) Goto page 1, 2 Next |
Author |
|
DimonSoft 11 Jul 2020, 16:42
Restorator used to be a great tool. Cracked versions sometimes have issues running on modern Windows systems (tend to register executables to themselves, but there’s an easy fix, just find it and read carefully before using).
It can create RES-files directly, edit resource sections in PE files (say, replace resources from files, etc.), has RC-like text editing mode, and as for dialog resources it provides an almost WYSIWYG environment. |
|||
11 Jul 2020, 16:42 |
|
Overclick 11 Jul 2020, 18:07
I tried to use my own RC on Restorator to convert it to Res -- still the same issue. Check attached screenshot.
I tried to create new Res or RC but don't know how to add simple elements on mine dialogue window/tree? Maybe something wrong with my version of Restorator or it's absolutely useless
|
||||||||||
11 Jul 2020, 18:07 |
|
DimonSoft 11 Jul 2020, 19:35
I don’t get what exactly should be paid attention to at the screenshot. I see two windows rich with controls, just with two different styles.
If you try Restorator, you just create a .res file there, add resources (say, dialog resource) and them switch to Edit mode. One of possible modes there is text editing mode. There you get syntax similar to RC-files to add and adjust any child windows. A comment with description of the syntax is provided by Restorator as well. Switching to another editing mode lets one see what the dialog is going to look like. The .res file can be saved as… uhm… a .res file and added to FASM PE source as shown in FASM.pdf: Code: resdata SomeLabel
file 'MyFile.res'
endres |
|||
11 Jul 2020, 19:35 |
|
Overclick 11 Jul 2020, 21:12
Exactly! Missing styles. I use this form of res adding is it wrong?
Code: section '.rsrc' resource from 'MyFile.res' data readable If I want to add each element by text editing I don't think I need any redactor at all, but I asking for specialized Editor where I can adjust elements by simple mouse clicking or convert my job without styles loosing. |
|||
11 Jul 2020, 21:12 |
|
bitRAKE 11 Jul 2020, 22:21
http://www.angusj.com/resourcehacker/ is quite powerful! It can work with EXE, RES, RC, etc ...
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
11 Jul 2020, 22:21 |
|
Overclick 11 Jul 2020, 22:43
I tried already. Seems like fasm issue. Did you guys used it before this way?
|
||||||||||
11 Jul 2020, 22:43 |
|
Ali.Z 12 Jul 2020, 02:06
Overclick wrote: Hi friends try mircosoft resource compiler, it will compile rc files to res. then in fasm use this: section '.rsrc' resource data readable from 'yourfilename.res' ; it must be in same directory 4) ... the graphic styles are affected by the GUI subsystem. for example: format PE GUI 4.0 is different than 6.0, and dialog boxes from resource are most affected by this subsystem version. you can also try 3.1 which is also different than 4.0 _________________ Asm For Wise Humans |
|||
12 Jul 2020, 02:06 |
|
DimonSoft 12 Jul 2020, 08:44
Styles have nothing to do with resource files or compiler. You might want to start from here: https://docs.microsoft.com/en-us/windows/win32/controls/cookbook-overview
|
|||
12 Jul 2020, 08:44 |
|
Tomasz Grysztar 12 Jul 2020, 08:49
DimonSoft wrote: Styles have nothing to do with resource files or compiler. |
|||
12 Jul 2020, 08:49 |
|
DimonSoft 12 Jul 2020, 09:26
Tomasz Grysztar wrote: Manifest file, described in the article you linked, needs to be included as a resource, so this very much has something to do with resources. Yep. But not with some bugs or misbehaviour of either resource compiler or FASM. |
|||
12 Jul 2020, 09:26 |
|
Ali.Z 12 Jul 2020, 09:50
Overclick, here is an example:
try changing the subsystem version from 4.0 to 3.1, and notice the difference.
_________________ Asm For Wise Humans |
|||||||||||
12 Jul 2020, 09:50 |
|
Ali.Z 12 Jul 2020, 10:43
Overclick wrote: I tried already. Seems like fasm issue. Did you guys used it before this way? almost forgot to comment on this, what you see on the left side which is the editor obviously; the controls are rendered using CreateWindowEx that is why they look different. but when compiled into a resource and used in a dialog box, then the dialog box manager will render it differently, of course that depends on the subsystem. so if you want the modern look, you either use OWNERDRAW, or use CreateWindowEx. _________________ Asm For Wise Humans |
|||
12 Jul 2020, 10:43 |
|
Overclick 12 Jul 2020, 11:09
SUCCESS
format PE64 GUI 6.0 (any) deal almost nothing with that, but I added Manifest file on RadAsm to my exist RC and it renders just fine. Ali.Z I tried to use CreateWindowEx. Could you explain for the future how to link exist dialogue file to this function? I gave up and use DialogBoxParam. |
|||
12 Jul 2020, 11:09 |
|
DimonSoft 12 Jul 2020, 15:55
CreateWindowEx is what should internally be used by the dialog functions. Dialogs are just windows of a specific window class, so switching to CreateWindowEx won’t change anything. Except that you get more control over parameters passed (though most values are passed unchanged by the dialog functions) and lose the possibility to specify coordinates in dialog units instead of pixels (which is probably for good).
|
|||
12 Jul 2020, 15:55 |
|
bitRAKE 12 Jul 2020, 17:11
Quote: DEBUGGING RULES: _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
12 Jul 2020, 17:11 |
|
Overclick 12 Jul 2020, 22:58
DimonSoft
1) As I see CreateWindowEx needs to be called for each daughter unit separately. Am I wrong? It's a massive job to do if so. 2) How to link dialogue? Have I do it by hMenu some how or call it later from Window Proc? 3) What to do with styles parameters? How can I get them from Res file to call CreateWindowEx proper? Too many questions for me. If you trying to help then show it on example please. |
|||
12 Jul 2020, 22:58 |
|
DimonSoft 13 Jul 2020, 04:57
Overclick wrote: 1) As I see CreateWindowEx needs to be called for each daughter unit separately. Am I wrong? It's a massive job to do if so. Yep. It’s a recursive job over a tree-like structure that a dialog resource is. Quite a simple piece of code except that for dialogs is has a lot of backwards-compatibility quirks. There’s nothing wrong with dialogs but I personally prefer to have pixel-perfect control over my windows (especially in the days of high-DPI and multimonitor setups) instead of messing with measurements relative to dialog font size. Which doesn’t change the fact that windows are a more basic concept and dialogs are built on top of them hiding certain things but providing a simpler API for common tasks. Overclick wrote: 2) How to link dialogue? Have I do it by hMenu some how or call it later from Window Proc? Why are you talking about WindowProc while using dialogs? It’s DialogBoxParam/CreateDialogParam in the “main” program plus DialogProc at the dialog side. If you mean the idea of implementing the dialog with plain CreateWindowEx, see the answer to the first question: you basically iterate through the tree and create windows. To show the “dialog” modally you run another message loop at the point you should show it. Also IsDialogMessage might be useful to have tab stops and similar features is a cleaner way. Overclick wrote: 3) What to do with styles parameters? How can I get them from Res file to call CreateWindowEx proper? If you really decide to use dialog resources but reimplement them with plain CreateWindowEx, there’re to things I should say. First: please don’t. If you need a dialog, use a dialog and let the OS deal with all the quirks. The only reason to switch to CreateWindowEx from dialogs is to have more control over what your program does (see notes above). Second: if you’re still eager to reimplement this stuff yourself, possibly changing some pieces, you might want to start with this page. |
|||
13 Jul 2020, 04:57 |
|
Overclick 13 Jul 2020, 09:10
DimonSoft
I don't use CreateWindowEx for dialogue. That was your advice to use it for "more control", then it need WindowProc too. All units needs to be called separatelly by WM_CREATE section and Child windows. But to call it I need to load proper settings from Res file for each unit first. As I see I need to call FindResourceEx LoadResource SizeofResource LockResource etc Can you show any example how to do that? |
|||
13 Jul 2020, 09:10 |
|
DimonSoft 13 Jul 2020, 11:11
Overclick wrote: I don't use CreateWindowEx for dialogue. That was your advice to use it for "more control", then it need WindowProc too. All units needs to be called separatelly by WM_CREATE section and Child windows. But to call it I need to load proper settings from Res file for each unit first. As I see I need to call FindResourceEx LoadResource SizeofResource LockResource etc First of all, DimonSoft wrote: If you really decide to use dialog resources but reimplement them with plain CreateWindowEx, there’re two things I should say. First: please don’t. If you need a dialog, use a dialog and let the OS deal with all the quirks. You somehow make me responsible for driving you through a complex and mostly useless process of recreating an ecosystem that is broken by design (see my note about specifying the coordinates in resources in DLU instead of pixels which are later used at runtime). If you mean this post: DimonSoft wrote: CreateWindowEx is what should internally be used by the dialog functions. Dialogs are just windows of a specific window class, so switching to CreateWindowEx won’t change anything. Except that you get more control over parameters passed (though most values are passed unchanged by the dialog functions) and lose the possibility to specify coordinates in dialog units instead of pixels (which is probably for good). it doesn’t state that you should use CreateWindowEx, it just states that DialogBoxParam/CreateDialogParam are based on CreateWindowEx, so switching to it might not magically give you what you initially wanted. Still, if you’re so willing to dive deeper, let me delegate the task of showing a large piece of code I have to either cut out of my code base (adding the pieces that were unnecesary for my task, most of the pieces) or write again from scratch to a much more trustable person on the topic, the one who actually took part in creating the whole dialog stuff in Windows: The dialog manager, part 1: Warm-ups The dialog manager, part 2: Creating the frame window The dialog manager, part 3: Creating the controls The dialog manager, part 4: The dialog loop The dialog manager, part 5: Converting a non-modal dialog box to modal The dialog manager, part 6: Subtleties in message loops The dialog manager, part 7: More subtleties in message loops The dialog manager, part 8: Custom navigation in dialog boxes The dialog manager, part 9: Custom accelerators in dialog boxes Obligatory note once again: mixing CreateWindowEx and DialogBoxParam/CreateDialogParam for the same window is possible but might not be a good idea from consistent-code-style point of view, reimplementing the dialog box functions might be a cool educational task but almost never pays back for anything else. |
|||
13 Jul 2020, 11:11 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.