🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13045

CallWindowProc compile problem

#13045
From: Jan
Date: Fri, 31 Oct 2003 13:33
63 lines
2758 bytes
Hello,

I try to write a DLL to read all the window handles of the open windows.
When the user press the ESC key in a preview window of the Visual
Foxpro application, the DLL must catch that and return.

But I get the next errors when I try to compile:
Cannot convert 'void *' to 'int(__stdcall *)()
type mismatch in parameter 'lpPrevWndFunc' (wanted 'int(__stdcall *)()'
got 'void *'

Code snippet:

void *oldProc;
oldProc = (void
*)SetWindowLong((HWND)MyChilds[iPV].lChildWindow,GWL_WNDPROC,(LONG)(Hand
leWindowMessage));

LRESULT CALLBACK HandleWindowMessage(HWND hwndDlg, UINT uMsg, WPARAM
wParam, LPARAM lParam)  /// LRESULT
{
    LRESULT retvalue = 0 ;
    int i ;

    for(i=0; i < iWindow; i++) {
     if(MyWindows[i].lWindow == (long)hwndDlg) {            //-- the
right window ?
      switch (uMsg) {                                       //--
Keypress ?
        case WM_CHAR:
        case WM_KEYUP:
        case WM_KEYDOWN:
        case WM_SYSKEYUP:
        case WM_SYSKEYDOWN:
        case WM_SYSCHAR:
          if (wParam != VK_UP && wParam != VK_DOWN && wParam != VK_LEFT
&& wParam != VK_RIGHT) {
            SendNotifyMessage((HWND)MyWindows[i].lWindow,uMsg, wParam,
lParam) ;
            if (wParam == VK_RETURN && uMsg == WM_KEYDOWN) {         //
Pass it through Visual Foxpro
              SendNotifyMessage((HWND)MyWindows[i].lWindow,WM_CHAR,
wParam, lParam) ;
              break ;
            }             //-- if (wParam == VK_RETURN && uMsg ==
WM_KEYDOWN)
          }               //-- if (wParam != VK_UP && wParam != VK_DOWN
&& wParam != VK_LEFT && wParam != VK_RIGHT)
         break;
        default:
         return CallWindowProc(oldProc, hwndDlg, uMsg, wParam, lParam);
//-- COMPILE ERROR
          //break;
      }                       //-- switch(uMsg)
     }                        //-- if(MyWindows[i].lWindow ==
(long)hwndDlg)
    }                         //-- for(i=0; i < iWindow; x++)

	return (0) ;
}

Thanks,
Jan
Technical Details
Message-ID: <3fa272d6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,dce1be079b294b08,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-31 06:39:20 PST
From: "Jan" <jan@jlcsoft.com>
Subject: CallWindowProc compile problem
Newsgroups: borland.public.cppbuilder.nativeapi
User-Agent: XanaNews/1.15.7.2
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 81.82.220.99
Message-ID: <3fa272d6$1@newsgroups.borland.com>
Date: 31 Oct 2003 06:33:58 -0700
X-Trace: newsgroups.borland.com 1067610838 81.82.220.99 (31 Oct 2003 06:33:58 -0700)
Lines: 63
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail