Page 1 of 1

Concept of REDEFINE for Dummy

PostPosted: Sun Feb 26, 2023 7:05 am
by Jimmy
hi,

i do not know Technique of using *.RC and REDEFINE
"where" can i learn more about it how to use with Fivewin :?:

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Feb 26, 2023 8:34 am
by Antonio Linares
Dear Jimmy,

Please make a search for REDEFINE in FWH\samples\*.prg

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Feb 26, 2023 10:09 am
by Jimmy
hi Antonio,
Antonio Linares wrote:Please make a search for REDEFINE in FWH\samples\*.prg

that is exact my "Problem"

i do "see" them but not "understand" what they are for and "how" it work e.g. ID
what is the benefit use use *.RC :?:

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Feb 26, 2023 10:23 am
by Antonio Linares
You create a RC file using a visual RC designer and then use it from your FWH app

You can use the one provided in Visual Studio Community, ResEdit, PellesC, etc there are many availables

You visually "draw" your screens instead of calculating coors by try and error...

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Feb 26, 2023 10:31 am
by Jimmy
hi Antonio,

WOW, i did not know that Technique.

i did know 2-Way "Form-Designer" but they "generate Full Source" CODE but never think of *.RC

but how is *.PRG Part
will it "generate" too :?:

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Apr 02, 2023 4:02 am
by Jimmy
hi,

Question :
how does REDEFINE a "say" ("Static") when ID are 0xFFFF or -1 :?:
Image

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Apr 02, 2023 1:50 pm
by cmsoft
Jimmy:
It has to have an id other than -1 to be able to assign redefines
Change RC with an ID.

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Apr 02, 2023 2:42 pm
by cnavarro
The only problem we found in the use of this technique (dialog design in .RC) is the adaptation of these designs to screens of different resolutions.
But everything can be solved, with Fivewin, everything is possible.

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Apr 02, 2023 3:27 pm
by Jimmy
hi,

cmsoft wrote:It has to have an id other than -1 to be able to assign redefines
Change RC with an ID.

i can´t change ID while it is from Windows ;)
i use that "search/replace" Dialog which e.g. Notepad.EXE have

based on c:\fwh\source\classes\dlgfind.prg i found out that i can REDEFINE "Windows standard Common Dialog"
it have to do with (undocumented) Function RegDialog()

as i want to use "Dark-Mode" those "Common Control" are still "white" which i try to change
as you can "see" i can change some Color but those "Say" (wC_STATIC) have ID 0xFFFF or -1 ... :(

---

Question :

instead of
Code: Select all  Expand view
  REDEFINE BUTTON

i have try
Code: Select all  Expand view
  REDEFIBE BTNBMP

this seems to work but "Parent Window" seem not to get "Userdef Event" ...

i have try oWnd:SendMsg() or oWnd:PostMsg() but i got no Result

Question :
can i can change BUTTON to "something" else ? ( or is there a limitation IsKinof("BUTTON) in RegDialog() ... )

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Apr 02, 2023 3:46 pm
by Jimmy
hi,
cnavarro wrote:The only problem we found in the use of this technique (dialog design in .RC) is the adaptation of these designs to screens of different resolutions.

i agree that these "old" Windows "Common Control" are made for Screen like VGA but much to small for FULL-HD

but i never know that i can REDEFINE Controls of those "Common Control"
my 1th Idea was to change Color for "Dark-Mode" ...

---

when REDEFINE i got hWnd in ::aControl so i can "paint it black"
but i need ID of Control for REDEFINE and each ID must be "unique" so i get only 1st "say"

Question
how to get hWnd of each Control in Dialog :?:

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Apr 02, 2023 3:47 pm
by Antonio Linares
Dear Jimmy,

Try with TPanel as it is a very simple control

Re: Concept of REDEFINE for Dummy

PostPosted: Sun Apr 02, 2023 5:46 pm
by Marc Venken

Re: Concept of REDEFINE for Dummy

PostPosted: Mon Apr 03, 2023 6:21 am
by Jimmy
hi Antonio,
Antonio Linares wrote:Try with TPanel as it is a very simple control

thx for Answer

i don´t want to create "new" Control.
i want to "modify" existing Windows "Common Control"

i´m testing REDEFINE and found out that i can get hWnd of existing "Common Control" when have Resource ID
but for "Say" i got only 0xFFF or IDC_STATIC (-1) so i can´t get hWnd

that´s why i ask
how to get hWnd of each Control in Dialog :?:

Re: Concept of REDEFINE for Dummy

PostPosted: Mon Apr 03, 2023 1:27 pm
by Jimmy
hi,

it seem that REDEFINE does only work with FINDTEXT() as it return a Handle
Code: Select all  Expand view
  hdlg = FindText(&fr);

https://learn.microsoft.com/de-de/windows/win32/dlgbox/using-common-dialog-boxes?redirectedfrom=MSDN

other like
Code: Select all  Expand view
  if (ChooseColor(&cc)==TRUE)
   if (ChooseFont(&cf)==TRUE)
   if (GetOpenFileName(&ofn)==TRUE)
   if (PrintDlg(&pd)==TRUE)
   if (PageSetupDlg(&psd)==TRUE)

seems not return Handle

so that Way is a "dead end" trying "Dark-Mode"