RE: Who can write an inputbox.e?
- Posted by Al Getz <Xaxo at aol.com> Feb 19, 2003
- 447 views
Liu Junfeng wrote: > I used this program in my application, but the result of input_box > function is always {0}, though it works well in other tests. > > Don Phillips wrote: > > > Don, > > > > > > Neat!! > > > > > > I had to change: > > > CreateWindow = define_c_func( Lib1, "CreateWindowExA", > > > ,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG}, > > > C_LONG ), > > > > > > to: > > > CreateWindow = define_c_func( Lib1, "CreateWindowExA", > > > > > > {C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LONG,C_LON > > > > > > > > > G,C_LONG}, > > > C_LONG ), > > > > > > to get it to work, hope that's correct?? > > > (added two more "C_LONG" & a "{" ) > > > > Yes that is correct, for some reason sometimes when I post long lines > > they tend to truncate. I also hope Lui will be able to use it. Maybe > > in the future I will have some time to play around with making templates > > > > > > in memory... > > > > > Euphoria is one of my favorite languages! > > Hi there Liu! Im not sure what you are doing there, but if all you need is a way to call the CreateWindowEx function from Euphoria, try checking out the help program posted on the main Euphoria site. Here's an excerpt from the Windows Api section: -------------------------------------------------- CreateWindowEx Note: We don't use the function "CreateWindow" anymore because it doesnt support the extended styles. Purpose: The CreateWindowEx function creates an overlapped, pop-up, or child window with an extended style. Win form: HWND CreateWindowEx( DWORD dwExStyle,// extended window style LPCTSTR lpClassName,// address of registered class name LPCTSTR lpWindowName,// address of window name DWORD dwStyle,// window style int x,// horizontal position of window int y,// vertical position of window int nWidth,// window width int nHeight,// window height HWND hWndParent,// handle of parent or owner window HMENU hMenu,// handle of menu, or child-window identifier HINSTANCE hInstance,// handle of application instance LPVOID lpParam // address of window-creation data ); Eu form: include dll.e constant CP=C_POINTER,DW=C_ULONG,CI=C_INT atom user32 user32 = open_dll("user32.dll") global constant xCreateWindow = define_c_func(user32, "CreateWindowEx", {DW,CP,CP,DW,CI,CI,CI,CI,CP,CP,CP,CP}, CP) atom hwnd,dwExStyle,lpClassName,lpWindowName,dwStyle, x,y, nWidth, nHeight,hWndParent,hMenu,hInstance,lpParam hwnd=c_func(xCreateWindowEx,{ dwExStyle,lpClassName,lpWindowName,dwStyle, x,y, nWidth, nHeight,hWndParent,hMenu,hInstance,lpParam}) returns: hwnd=0 failure hwnd>0 success, the window's handle Notes: 1. The Windows system can support a maximum of 16,364 window handles. 2. lpParam is usually made equal to zero (0) unless creating a multiple document interface, in which case it points to a CLIENTCREATESTRUCT struct. 3. The hMenu is usually made equal to zero (0) and the menu is created later with CreateMenu{} and then added to the window with SetMenu(). 4. hWndParent is the handle of the parent window, or zero (0) if none. 5. lpClassName points to a null terminated string that specifies the class name, or is a global atom. The class name can be any of the predefined types or a name that was registered with the RegisterClass() function. -------------------------------------------------- Good luck with it, Al