Advertisement

Tab key / procedure

Started by June 13, 2000 11:28 PM
2 comments, last by des3d 24 years, 6 months ago
Hi All, I am currently learning Windows programming, and now I have a problem to set the tab orders for the controls e.g I have two Edit controls called: "edit1" and "edit2" does anyone knows how can I use the Tab key to move the input focus from "edit1" to "edit2". P.S In the Programming Windows 95 book, it said you can use window subclassing, I tried that, but it won''t let me compile, with the following error message: Error: colors1.c(239,69):Type mismatch in parameter ''lpPrevWndFunc'' in call to ''CallWindowProcA'' please if could help me. lots of thanks DES3D
If it''s a simple window or actually even a complex window, use a dialog editor and use a dialog box as main window. This is actually kindof the way windows was designed. Dialog boxes have the same color background as the neutral 3D color so controls belnd seamlessly and it handles the tab key as well as severl other like space, enter, pageup, pagedown, home, end, arrow keys and such. Works great!
See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
Advertisement

Most probably your subclass wnproc is declared incorrectly

Try

LRESULT CALLBACK TheSubClassProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{

}


if the STRICT macro is defined (it should be). If not you need to declare it as FAR WINAPI*.

..
Thanks Cyberben and Void''s replies

for Cyberben,
Yes, I knew the diag box is very good, but I want to learn to use the window,

for Void,
my declaration is right, but it still complain about the last line: "return CallWindowProc..."

LRESULT CALLBACK ScrollProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
...
...
return CallWindowProc (fnOldScr, hwnd, iMsg, wParam, lParam) ;
}

how can use the strict macro??

This topic is closed to new replies.

Advertisement