I've seen that problem before, and if memory serves, it had something to do with either handling (or NOT handling) something along the lines of WM_PAINT, or erase background (or a function similar).
So you may want to check your code there.
Announcement
Collapse
No announcement yet.
Dialog Disabled?
Collapse
X
-
If user presses the <enter> key(to execute a OK button), it leaves a "Black Shadow" on maindialog
Except I usually get a "white empty box" when I do that.
Leave a comment:
-
Adam,
Using "Visible" instead of enable. Below code works.
rem Test Visible Dialog
Visible = IsWindowVisible(hDlg54)
rem ? "Visible hDlg54= "+STR$(visible) ' = 0 - 1=visible, 0=not visible
IF Visible = 1 THEN
DIALOG REDRAW hDlg54
ELSE
rem Visible = IsWindowVisible(hDlg)
rem ? "Visible hDlg= "+STR$(Visible)
DIALOG REDRAW hDlg
END IF
After further testing, don't really need "Dialog redraw". The problem is from popup dialogs for selecting printer and tray options and other message boxes.
If user presses the <enter> key(to execute a OK button), it leaves a "Black Shadow" on maindialog. The solution for my program which uses a keyhook, is to simply use a global variable that tells the keyhook function, if the <enter> key is pressed, keypress equals 32 <spacebar>. This does away with shadow caused
by pressing the <enter> key.
Leave a comment:
-
Won't hurt anything, but could cause a little bit of 'flicker'. Why do you need to redraw the entire dialog?
Leave a comment:
-
Adam,
Thanks, I was looking at wrong example. The following code
seems to work correctly. Sometimes though, both dialogs are
enabled, but ofcourse only 1 showing. Is it still OK to do
a "Dialog redraw" for both dialogs?
rem 1=enabled, 0=disabled
Enabled = IsWindowEnabled(hDlg54)
? "Enabled 54= "+STR$(Enabled)
IF Enabled = 1 THEN
DIALOG REDRAW hDlg54
END IF
Enabled = IsWindowEnabled(hDlg)
? "Enabled= "+STR$(Enabled)
IF Enabled = 1 THEN
DIALOG REDRAW hDlg
END IF
Thanks,
Brent
Leave a comment:
-
Doesn't work for me?
I would say your visible code check fails as well.
You should not be using GetDlgItem for actual dialogs. GetDlgItem should only be used when you do not have the Window Handle to a control. hDlg (or CBHNDL) is actually a valid Windows Handle.
Leave a comment:
-
Or - assuming the 'active' dialog is the one which called the printing function - pass the CBHNDL of the dialog to the printing function, then you don't even have to know...
Code:FUNCTION PrintingFunction (BYVAL hDlg AS LONG, other params) .... DIALOG REDRAW hDlg END FUNCTION
Leave a comment:
-
Peter,
Thanks for responding so quickly. Doesn't work for me?
I Get 0 whether disabled or enabled 1=enabled, 0=disabled
Visible = IsWindowVisible(GetDlgItem(hWnd, hDlg54)) 'hDlg)) '(hDlg, id&))
? "Visible= "+STR$(visible) ' = 0 - 1=enabled, 0=disable
Enabled = IsWindowEnabled(GetDlgItem(hWnd, hDlg54)) 'hDlg)) '(hDlg, id&))
? "Enabled= "+STR$(Enabled)
Leave a comment:
-
Dialog Disabled?
Hi,
My program calls print routines from 2 different dialogs that are
both created and running. One or the other is disabled while the
other does it's thing.
Need to know which one is NOT disabled, for a "Dialog redraw hDlg"
or "Dialog redraw hDlg54".
This msgbox: ? "hDlg= "+str$(hDlg)+" hDlg54= "+str$(hDlg54),
returns numbers: 5111992 and 1835468. What do they mean?
Can one tell which dialog is active and which one is "Disabled"?
Can use a global flg variable to tell routine, which dialog called
it, but was wondering if better way?
Thanks,
BrentTags: None
Leave a comment: