Selecting a cell and giving it focus programatically
Posted by RyanS
on 07/17/2014 12:09am
I am looking for a way to programmatically give a cell keyboard focus. Based on a previous comment BGM_SETCURSORPOS and BGM_DRAWCURSOR are the messages I would need to do this (correct me if I am wrong though). I have tried passing various combinations as wParam and lParam (including coordinates and grid structures) but cannot seem to get the cell receive keyboard focus. Does anyone know how I should be using these two messages, or if it is even possible to make a cell active without the user clicking it?
On a somewhat related note, the program header mentions a reference or tutorial being available, does anyone where to find that?
Thanks very much,
I have included BABYGRID in my existing win32 project, and I got it to compile. The problem is, I cannot seem to get the grid control to display - the rest of the program and control display properly, and if I change the type of control from "BABYGRID" to "EDIT" or something else, it does show up.
Some more information:
I am using MinGW and Code::Blocks (it installs with support for win32 by default, and I have successfully made small win32 apps with it)
I tried calling GetLastError immediately after CreateWindowEx, and the error code is zero (When trying to create a BABYGRID).
The HWND returned by the call to CreateWindowEx is null.
I included cctype in BabyGrid.cpp as the compiler was complaining functions such as isalpha were not defined. This seemed to fix the problem.
I included the .cpp and .h files into my project directly instead of compiling a static library (I don't assume that matters?)
Thanks very much in advance for helping! Also, thanks to Mr. Hillard for developing BabyGrid.