|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
D - How to include Win32 function
How to include into progect the Win32 function: ShowWindow() MoveWindow() GetWindowLong() SetWindowText() SendMessage() EnumChildWindows() Anatoliy Shevelev http://esk.lgg.ru Jun 07 2004
import std.c.windows.windows; "Anatoliy Shevelev" <ixbase insyg.kiev.ua> wrote in message news:ca2hp6$11su$1 digitaldaemon.com...How to include into progect the Win32 function: ShowWindow() MoveWindow() GetWindowLong() SetWindowText() SendMessage() EnumChildWindows() Anatoliy Shevelev http://esk.lgg.ru Jun 07 2004
I'm use thise command at my project but not all function work properly "Walter" <newshound digitalmars.com> wrote in message news:ca2lfa$17r5$2 digitaldaemon.com...import std.c.windows.windows; "Anatoliy Shevelev" <ixbase insyg.kiev.ua> wrote in message news:ca2hp6$11su$1 digitaldaemon.com...How to include into progect the Win32 function: ShowWindow() MoveWindow() GetWindowLong() SetWindowText() SendMessage() EnumChildWindows() Anatoliy Shevelev http://esk.lgg.ru Jun 08 2004
Anatoliy Shevelev wrote:I'm use thise command at my project but not all function work properly Jun 09 2004
I'm understand, if function missing to including it's to the project as
but appear a new problem with function
?? EnumChildWindows(hWnd, myProc, (LPARAM) &rcClient);
error
C:\dmd\samples\d>\dmd\bin\shell ixb.sh
shell 1.00
\dmd\bin\dmd ixbase.d gdi32.lib
ixbase.d(25): function myProc (HANDLE hwndChild,int lParam) does not match
argument types ()
--- errorlevel 1
//----------------------------------------------------
import std.c.windows.windows;
import std.c.stdio;
import std.date;
export
{
LRESULT SendMessage(HWND ,UINT ,WPARAM , LPARAM );
BOOL SetWindowTextA(HWND hWnd,LPCSTR lpString);
}
//-----------------------------------------------------------
const int IDC_BTNCLICK = 101;
const int IDC_BTNDONTCLICK = 102;
HWND hW,ghStatBar,hE,hFRM,hSTA,hCUR;
int sock,hS=0,nCurEle=0,ixH=16;
extern(Windows)
int WindowProc(HWND hWnd, uint uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_SIZE:
{
RECT rcClient;
GetClientRect(hWnd, &rcClient);
?? EnumChildWindows(hWnd, myProc, (LPARAM) &rcClient);
} break;
case WM_KEYDOWN:
{
char [64] s;
sprintf(s,"%3d",wParam);
MaxRow();
_X_STA("keyDown",s);
} break;
default:
break;
}
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
}
//--------------------------------------------------------
bool myProc(HWND hwndChild, LPARAM lParam)
{
LPRECT rcParent;
int i, idChild;
// idChild = GetWindowLong(hwndChild, GWL_ID);
rcParent = (LPRECT) lParam;
if (idChild == 101){
// MoveWindow(hwndChild,30,0,rcParent.right,16,TRUE);
}else if (idChild == 102){
i=0;
// MoveWindow(hwndChild,0,40,rcParent->right,rcParent->bottom-56,TRUE);
}else if (idChild == 1001){
// MoveWindow(hwndChild,192,20,rcParent->right-340,16,TRUE);
}else
i = 2;
ShowWindow(hwndChild, 1);
return TRUE;
}
Anatoliy
Jun 09 2004
"Anatoliy Shevelev" <ixbase insyg.kiev.ua> escribió en el mensaje news:ca7jdc$689$1 digitaldaemon.com | I'm understand, if function missing to including it's to the project as | | but appear a new problem with function | | ?? EnumChildWindows(hWnd, myProc, (LPARAM) &rcClient); | error | | | | | C:\dmd\samples\d>\dmd\bin\shell ixb.sh | shell 1.00 | \dmd\bin\dmd ixbase.d gdi32.lib | ixbase.d(25): function myProc (HANDLE hwndChild,int lParam) does not match | argument types () | | --- errorlevel 1 | | ... | You need an & before myProc: EnumChildWindows(hWnd, &myProc, (LPARAM) &rcClient); ----------------------- Carlos Santander Bernal Jun 09 2004
Thanks Carlos,
and last version
EnumChildWindows(hWnd,(WNDENUMPROC) &IxbProc, (LPARAM) &rcClient);
Anatoliy
Jun 10 2004
"Anatoliy Shevelev" <ixbase insyg.kiev.ua> escribió en el mensaje news:caa0s1$sgn$1 digitaldaemon.com | Thanks Carlos, | and last version | EnumChildWindows(hWnd,(WNDENUMPROC) &IxbProc, (LPARAM) &rcClient); | | Anatoliy | Finally, you'll want to change those C-style casts to D-style. ----------------------- Carlos Santander Bernal Jun 10 2004
I'm will but can't solve the problem with, for example export void InitCommonControls(void); error C:\dmd\samples\d>\dmd\bin\shell ixb.sh shell 1.00 \dmd\bin\dmd ixbase.d gdi32.lib C:\dmd\bin\..\src\phobos\std\c\windows\windows.d(1818): cannot have parameter of type void --- errorlevel 1 AnatoliyFinally, you'll want to change those C-style casts to D-style. ----------------------- Carlos Santander Bernal Jun 11 2004
In article <cacsa7$22uv$1 digitaldaemon.com>, Anatoliy Shevelev says...I'm will but can't solve the problem with, for example export void InitCommonControls(void); Jun 11 2004
"Sean Kelly" <sean f4.ca> wrote in message news:cact6g$2440$1 digitaldaemon.com...In article <cacsa7$22uv$1 digitaldaemon.com>, Anatoliy Shevelev says...I'm will but can't solve the problem with, for example export void InitCommonControls(void); Jun 11 2004
In article <cae6m3$ug5$1 digitaldaemon.com>, Matthew says...You forgot "Is necessary in C, " Jun 12 2004
Interesting point. I have to say I can't imagine that to be the case - too much back compat - but you never know. If I was sufficiently motivated I'd boot up Acrobat and have a scour, but I'm not. Maybe I'll just try it with Comeau and --strict. (But Walter might bite me for not trusting DMC++!! <G>) "Sean Kelly" <sean f4.ca> wrote in message news:caf79o$2je6$1 digitaldaemon.com...In article <cae6m3$ug5$1 digitaldaemon.com>, Matthew says...You forgot "Is necessary in C, " Jun 12 2004
change but next error export void InitCommonControls(void); to export void InitCommonControls(); but next error C:\dmd\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _InitCommonControls 0 --- errorlevel 1 Anatoliy Jun 12 2004
Anatoliy Shevelev wrote:change but next error export void InitCommonControls(void); to export void InitCommonControls(); but next error C:\dmd\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _InitCommonControls 0 --- errorlevel 1 Anatoliy Jun 21 2004
|