Page 1 of 1

2 buttons on the taskbars.

Posted: Fri Aug 03, 2007 9:41 am
by falsam
-Windows XP : FnxBasic03

dim f as form
f.Caption="test"
f.showmodal

when i run this program, I obtains 2 buttons on my taskbar. A Form button and a button with the caption of this code. I do not have this bug with the old version of fnxbasic.

;) from Paris




2 buttons on the taskbars.

Posted: Sun Aug 12, 2007 11:37 am
by Marco
hi,

I know that is a problem if i do it the old way your form does not minimize to the task bar . One butt in the taskbar is for the applicasion and the other for the form. I `m not yet sure how the solve the problem, so for now on you can asign your application to the main form with this code:

[code]dim app as application
declare set_windowlong as "SetWindowLongA" of "user32.lib"
  hwnd As Long
nIndex As Long
dwNewLong As Long
end declare

sub setparent(fhwnd as integer)
set_windowlong.hwnd=app.handle
set_windowlong.nindex=-8
set_windowlong.dwnewlong=fhwnd
set_windowlong
end sub




``example

dim f as form
f.caption="test"

setparent(f.hwnd)

f.showmodal[/code]

best regards

2 buttons on the taskbars.

Posted: Mon Dec 14, 2009 4:52 am
by Manolo
Hi Marco!

I tried the code to avoid the double button on the taskbar with FNXBasic 2009 but when I compile the code I get

error: `=app.handle` not declared /unknow

What is wrong?

Thanks.

2 buttons on the taskbars.

Posted: Tue Dec 15, 2009 4:54 pm
by Marco
have you first dimmed the application

dim app as application

?
best regards

2 buttons on the taskbars.

Posted: Wed Dec 16, 2009 5:11 pm
by Manolo
Yes I have done it.
This is the code I used (copy and past).
----------- Start Code ---------------
dim app as application
declare set_windowlong as "SetWindowLongA" of "user32.lib"
hwnd As Long
nIndex As Long
dwNewLong As Long
end declare

sub setparent (fhwnd as integer)
set_windowlong.hwnd=app.handle
set_windowlong.nIndex=-8
set_windowlong.dwNewLong=fhwnd
set_windowlong
end sub

dim f as form
f.caption="test"

setparent(f.hwnd)

f.showmodal
-------- End Code -------------

It happens with any statement which contains the symbol of equal  `=` inserted in the sub setparent.
If I try to comment the first line in the sub I get the same error with the second line e so on.

Thanks.

2 buttons on the taskbars.

Posted: Fri Dec 18, 2009 10:41 pm
by Marco
First of all declare the variables not as long, fxn does not know what to do with it.
Declare the long variables as integer (is the same).

Second user32.lib does not exists it must be user32.DLL

Then try your code again.

best regards marco