News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to make a dataGrid in MASM32v10?

Started by FritzGamaliel, March 19, 2010, 03:21:59 AM

Previous topic - Next topic

FritzGamaliel

I have a problem. I want to make a datagrid in my program (MASM32v10). But I don't know how it's code....
Do you know how it's code? :bg
Your solution will be highvalue

Best regards,
Fritz Gamaliel

redskull

Strange women, lying in ponds, distributing swords, is no basis for a system of government

FritzGamaliel


FritzGamaliel

I have created a datagrid in windows(not dialog) with the structure below:

ID      Name     TotalAssets(US$)
1       A            55
2       B            23

Now, I have a problem:
1.  I want to get a data from column 3 row 2 (TotalAssets: 23). Then, I show it via MessageBox.
I have tried  code below:

   invoke SendMessage,hGrd,GM_GETCURROW,0,0
   mov      ecx,eax
   invoke SendMessage,hGrd,GM_CELLCONVERT,ecx,addr buffer
   invoke MessageBox,hWin,addr buffer,addr buffer,MB_OK

But it always show data from column 1 row 1 (ID: 1).

could you help me to solve my problem?
Thank you
Fritz

dedndave

we have no idea how GM_GETCURROW and GM_CELLCONVERT are defined
it sounds like they are always 0 - thus, you always see the first element

"datagrid" - i would just call it an "array"

MichaelW

They should be defined in RAGrid.inc:

GM_GETCURROW   equ WM_USER+12 ;wParam=0, lParam=0
GM_CELLCONVERT equ WM_USER+40 ;wParam=nRowCol, lParam=lpBuffer


You could verify that they are included by displaying their value, WM_USER = 400h.
eschew obfuscation

drizz

wparam = (row shl 16) or col. aka MAKEWPARAM(col,row).
The truth cannot be learned ... it can only be recognized.

FritzGamaliel

Now, I have a problem:

I have created 1 datagrid with the structure below:

ID     Name     TotalAssets(US$)
1      A            5
2      B            6
3      C            24

I want to change all data in TotalAssets' column with '-'. So, it's become:

ID     Name     TotalAssets(US$)
1      A            -
2      B            -
3      C            -

I have tried all code from KetilO' grid example. But, it just change the first row of TotalAssets' column.

ID     Name     TotalAssets(US$)
1      A            -
2      B            6
3      C            24

Could you help me to solve my problem?
Thank you
Fritz