Thanks and no problem. Haven't been able to look into it myself but the idea is to prevent a .bmp from being created in the first place.MichaelW wrote:GDI+ can do the conversion, Microsoft example here.
Sorry, no time to code an example.
Windows GUI
Re: Windows GUI
Re: Windows GUI
There is another issue where the window is not being updated until the mouse is moved or another user action is taken. Does this perhaps have anything to do with the Windows message system and is there a way to send messages periodically?
Re: Windows GUI
MichaelW Example (exerpt):If you stick the UpdateWindow( hwnd ) into the Loop, this should fix it.
Rewritten code portion:
Code: Select all
hwnd = CreateWindowEx( 0, "test", "Test", WS_OVERLAPPED or WS_SYSMENU, _
0, 0, 0, 0, NULL, NULL, NULL, NULL )
ShowWindow( hwnd, SW_SHOWNORMAL )
UpdateWindow( hwnd )
do while GetMessage( @msg, NULL, 0, 0 ) > 0
if IsDialogMessage(hwnd, @msg ) = 0 then
TranslateMessage( @msg )
DispatchMessage( @msg )
end if
loop
Rewritten code portion:
Code: Select all
hwnd = CreateWindowEx( 0, "test", "Test", WS_OVERLAPPED or WS_SYSMENU, _
0, 0, 0, 0, NULL, NULL, NULL, NULL )
ShowWindow( hwnd, SW_SHOWNORMAL )
do while GetMessage( @msg, NULL, 0, 0 ) > 0
UpdateWindow( hwnd ) ' <-- changed position (new)
if IsDialogMessage(hwnd, @msg ) = 0 then
TranslateMessage( @msg )
DispatchMessage( @msg )
end if
loop
Re: Windows GUI
Assuming I understand what you are trying to do, after you finish drawing the image use InvalidateRect to add the client area to the window's update region so the client area will be redrawn on the next WM_PAINT message.
You can use GetClientRect to copy the coordinates of the client area to a RECT structure that you then pass to the InvalidateRect function.
Your app will need a message loop, something like that shown above (but note that there will be no need to call UpdateWindow in the message loop), so it can receive and dispatch messages, and a window procedure that processes the necessary messages, which may be:
WM_CREATE
WM_PAINT
WM_TIMER
WM_CLOSE
WM_DESTROY
And possibly others depending on when you are drawing/redrawing the image, for example, drawing the image only once in the WM_CREATE handler, or at intervals in the WM_TIMER handler, or in response to some user action, etc.
You can use GetClientRect to copy the coordinates of the client area to a RECT structure that you then pass to the InvalidateRect function.
Your app will need a message loop, something like that shown above (but note that there will be no need to call UpdateWindow in the message loop), so it can receive and dispatch messages, and a window procedure that processes the necessary messages, which may be:
WM_CREATE
WM_PAINT
WM_TIMER
WM_CLOSE
WM_DESTROY
And possibly others depending on when you are drawing/redrawing the image, for example, drawing the image only once in the WM_CREATE handler, or at intervals in the WM_TIMER handler, or in response to some user action, etc.
Re: Windows GUI
Thanks allot MrSwiss and MichaelW. The issue is resolved now.
-
- Posts: 14
- Joined: Oct 23, 2016 1:22
Re: Windows GUI
MrSwiss wrote:Easy, write an additional file with: ProgName.rc
that contains something like:Thats all ...Code: Select all
FB_PROGRAM_ICON ICON "C:/Path/to/file/IconName.ico"
Sorry to bug you, but I can't seem to get this to work...
I've been using this in the RC file:
Code: Select all
FB_PROGRAM_ICON ICON "STS.ico"
Code: Select all
fbc "Program.bas" "Program.rc" -v
I'm also using win8.1 ( 64-bit )... if that makes any difference.FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target: win32, 486, 32bit
compiling: Program.bas -o Program.asm (main module)
assembling: C:\Users\<INSERT NAME HERE>\Desktop\Software\FreeBASIC\bin\win32\as.exe --30 --strip-local-absolute "Program.asm" -o "Program.o"
compiling rc: C:\Users\<NAME>\Desktop\Software\FreeBASIC\bin\win32\GoRC.exe /ni /nw /o /fo "Program.obj" "Program.rc"
Error!
No resources found in RC file
OBJ file not made
compiling rc failed: 'C:\Users\<NAME>\Desktop\Software\FreeBASIC\bin\win32\GoRC.exe' terminated with exit code 1
EDIT:
It would seem Windows 8 is being an issue (you don't say?).
Re: Windows GUI
Do you still need help Kazuma?
I want to thank everyone that helped me in this thread and in the other threads over the years. And special thanks to Lothar for the GUI and the FreeBASIC developers for a crazy fast BASIC.
Here's the program that came of this thread: https://drive.google.com/file/d/0B5r0rD ... dJQjA/view
No source or documentation. It is a powerful and quick homophonic substitution solver. It makes quick work of ciphers such as the Zodiac 408 and the second Beale cipher but no solution can be found for the Zodiac 340.
Feel free to join in for the quest to solve the Zodiac 340 in the cipher section at http://www.zodiackiller.net/ I am there as Jarlve.
I want to thank everyone that helped me in this thread and in the other threads over the years. And special thanks to Lothar for the GUI and the FreeBASIC developers for a crazy fast BASIC.
Here's the program that came of this thread: https://drive.google.com/file/d/0B5r0rD ... dJQjA/view
No source or documentation. It is a powerful and quick homophonic substitution solver. It makes quick work of ciphers such as the Zodiac 408 and the second Beale cipher but no solution can be found for the Zodiac 340.
Feel free to join in for the quest to solve the Zodiac 340 in the cipher section at http://www.zodiackiller.net/ I am there as Jarlve.
-
- Posts: 436
- Joined: Sep 28, 2013 15:08
- Location: Germany
Re: Windows GUI
Provoni, thank you for the presentation of your work! I am very pleased to see what you can do with my simple library.
I would be happy if somebody could help Kazuma, I never worked with icons and recource files.
I would be happy if somebody could help Kazuma, I never worked with icons and recource files.
Re: Windows GUI
Well, it's not the same as:Kamui_Kazuma wrote:Sorry to bug you, but I can't seem to get this to work...
I've been using this in the RC file:
Code: Select all
FB_PROGRAM_ICON ICON "STS.ico"
Code: Select all
FB_PROGRAM_ICON ICON "*full path to*/STS.ico"
replace *full path to* with the real path (to the icon file) in your code ...
Re: Windows GUI
Relative paths to the icon file are no problem; absolute paths are not required, I'd even say you should avoid using them as it voids portability. Additionally the error message would be a different one if the icon file couldn't be found.
However, I can't reproduce your problem / error message. Is there any other content in the .rc file? Have you tried a minimal example like this (put the files in the same folder):
test.bas
test.rc
test.ico: http://www.iconarchive.com/download/i20 ... -zilla.ico
put everything in a single folder and compile using:
However, I can't reproduce your problem / error message. Is there any other content in the .rc file? Have you tried a minimal example like this (put the files in the same folder):
test.bas
Code: Select all
screen 12: sleep
Code: Select all
FB_PROGRAM_ICON ICON "test.ico"
put everything in a single folder and compile using:
Code: Select all
fbc test.bas test.rc
Re: Windows GUI
Can you rewrite entirely the RC file to be sure than none non-printable character is eventually inserted inside it.Kamui_Kazuma wrote:Sorry to bug you, but I can't seem to get this to work...
I've been using this in the RC file:and this on the command line:Code: Select all
FB_PROGRAM_ICON ICON "STS.ico"
herein lies the problem:Code: Select all
fbc "Program.bas" "Program.rc" -v
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target: win32, 486, 32bit
compiling: Program.bas -o Program.asm (main module)
assembling: C:\Users\<INSERT NAME HERE>\Desktop\Software\FreeBASIC\bin\win32\as.exe --30 --strip-local-absolute "Program.asm" -o "Program.o"
compiling rc: C:\Users\<NAME>\Desktop\Software\FreeBASIC\bin\win32\GoRC.exe /ni /nw /o /fo "Program.obj" "Program.rc"
Error!
No resources found in RC file
OBJ file not made
compiling rc failed: 'C:\Users\<NAME>\Desktop\Software\FreeBASIC\bin\win32\GoRC.exe' terminated with exit code 1
-
- Posts: 14
- Joined: Oct 23, 2016 1:22
Re: Windows GUI
Thanks fro the tips but nothing is seeming to work... exept I did try doing this on windows XP (as opposed to 8.1) and this worked, so in conclusion...
Blame Windows 8.
Blame Windows 8.
Re: Windows GUI
Well, I've not had Win 8 for longer than some Months.
The Method works for certain, on Windows: Vista / 7 / 8.1 / 10.
If not, then plse. publish the .rc file, in its entirety ...
The Method works for certain, on Windows: Vista / 7 / 8.1 / 10.
If not, then plse. publish the .rc file, in its entirety ...
-
- Posts: 14
- Joined: Oct 23, 2016 1:22
Re: Windows GUI
uhh, that's all that was in it... maybe it has to do with the icon file itself? i've been using MSPaint for creating icons as bitmaps with a pixel depth of 4.MrSwiss wrote:Well, I've not had Win 8 for longer than some Months.
The Method works for certain, on Windows: Vista / 7 / 8.1 / 10.
If not, then plse. publish the .rc file, in its entirety ...
-
- Posts: 14
- Joined: Oct 23, 2016 1:22
Re: Windows GUI
This link apparently has some relation to some sort of malware, please look into this.St_W wrote:test.ico: http://www.iconarchive.com/download/i20 ... -zilla.ico
Also where is this icon from?