Original Post
Ok, i'm quite new to C++ and I've a problem I only half know how to solve, so heres the general jist. I'm connecting to mysql, and pulling mulitple records using a given SQL query, so the results are usually quite random as they are consistantly changed. I'm trying to create a list of records for the query, each has its own independant id, i wish to create a button for each (or just something clickable) to open the full record view into a new window, showing only that one record (hopefully explained that well enough for people to understand) Ok, now I have all the records displaying ok, so thats not the issue, its assigning a button for each (i can make the buttons show up fine as well), as they all have unique id's and no idea what way to do it The last thing i attempted doing was
Quote:The idea of this was to have the id as the value of the button, which would then be picked up by
hButton = CreateWindow("BUTTON", row[col], WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_BITMAP,temp2, temp1, 135, 27, hwnd, 0, g_hInst, 0);
Quote:Course I dont even know if this is possible for a start, obviously it would be crazy to assign independant names for each button as there could be dozens if id's used. Can anyone tell me if there is a way of finding the button value, or at least a more senisble way of doing this, the method i was working on was only thing i could come up with at the time and im sure theres a more efficent and less sloppy way of doing it. If this isnt the best place to be asking this, could you point me in the right direction of were i could obtain help, or at least a document to help, already google'd but obviously it's not the easiest thing to be looking for. I would paste the entire code but theres alot of it and most isnt relevant, also i would have put these in code tags but not sure how to do code tags on this forum. Thanks
switch(HIWORD(wParam)) { case BN_CLICKED: { switch(LOWORD(wParam)) { .... default: { //ID PICKED UP HERE }