|
Great !!
That's much more elegant
Thanks a lot
|
|
|
|
|
is there any way to get pixel size from HBITMAP?
(i want to center it into rectangle)
(most often it is loaded by LoadImage - maybe resource pixel size is available?)
t!
|
|
|
|
|
Use GetBitmapDimensionEx to get the dimensions of the bitmap.
|
|
|
|
|
but help speaks you must call set before (and it is not in pixels)
t!
|
|
|
|
|
First of all yes I know the answer, but if your are using Visual C++ and MFC, a simple search of the help sytem will give you the answer.
Example: (You could write this)
CSize GetSizeOfBitmap( CBitmap& MyBitmap )
{
BITMAP bmp;
MyBitmap.GetBitmap(&bmp);
return CSize(bmp.bmWidth,bmp.bmHeight);
}
------------------------------------
Trust in the code Luke. Yea right!
|
|
|
|
|
thanks
sometimes look and see is not the same
t!
|
|
|
|
|
Hello,
How about this way?
--------------------------------------
BITMAP bitmap = {0,};
GetObject(hBitmap, sizeof(BITMAP), &bitmap);
--------------------------------------
I wish this way is helpful to you.
Thanks.
|
|
|
|
|
I need to put data into array form. My data is :
0x12 0x24 0xAB
0x11 0xAA 0xBB
0xCC 0xDD 0xFF
Array[x][x] is to be created after counting the number of character on first row of the data . Then every 0x__ is store to one element example: Array[0][0] = 0x12, Array[0][1] = 0x24.
And also I need to be able to check if every 5th character is a spacing and every 1st character and 2nd character of each element is in 0x form. IF it is not 0x then a msg telling which Array[x][y] is incorrect or something like that.
I heard of using vector but I don't how I can give the specific location of the incorrect array[x][y]. But if I use array, my array size cannot be flexible as array size got to be declared with a size, where the 'size' cannot be given a value only after counting the number of characters
in the first row of data. Anyone can help?
|
|
|
|
|
i have bitmapbutton derived item
till the moment it has no BS_OWNERDRAW style is all normal (see next)
but having it (necessary for its functionality) it has no BS_PUSHBUTTON and BS_TEXT flags (spy look) (and it seems no way to set them) and: it never gets "default" button rectangle around i could understand its draw is wrong so it is not drawn but it seems problem is somewhere else - it jumps to another (ok) control
(does not matter if is BS_OWNERDRAW set into .rc or by function...)
is there something i'm doing wrong?
t!
|
|
|
|
|
|
:(I am making a C++ project on dialog base using MySql database. When I build it an error message appears:"C:\User\C++\SqlDialog\mysql.h(5) : fatal error C1083: Cannot open include file: 'afxdtctl.h': No such file or directory". I checked. There is no such header file in my computer. I use MS Dev.studio, rev. 5.
Pls. help me to solve my problem!!
|
|
|
|
|
I have been unable to pass a value from one class to the other in an SDI application in MFC. I tried it by declaring a static variable in a header file and then including this header file in both the classes.Then by incrementing value in one class and I tried to get in in the other class. That is not working properly. It is not updating the value.
Plz suggest me how to do it(i.e pass val. from one dialog to the other );
Suggest me the easiest ways of doing so. Because I am a beginner in VC++ so kindly guide me step by step.
Reply me soon
|
|
|
|
|
Same problem i am facing.
|
|
|
|
|
I want to incorporate a property sheet and pages in side a Form view.
Any solution??
With Thanks and Regards
--Kamesh
|
|
|
|
|
You need to do the following:
1) Add a frame control with ID_PLACEHOLDER into your dialog and use it to define size and position of the property sheet in your form/dialog.
2) In OnInitialUpdate() method of your form class use the following to create the property sheet (m_sheet is a member of the form class, a pointer to a property sheet class ):
CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER);
m_sheet = new CMyPropertySheet(pwndPropSheetHolder);
if (!m_sheet->Create(pwndPropSheetHolder,WS_CHILD | WS_VISIBLE,0))
{
delete m_sheet;
m_sheet = NULL;
return;
}
Pavel
Sonork 100.15206
|
|
|
|
|
Thanks for the sugesstion , i have done as u suggesst, but system is failing in allocating memory for the property sheet pointer, and returning.
What should i do??
With Thanks and Regards
--Kamesh
|
|
|
|
|
Are you creating it after the inherited OnInitialUpdate is called?
Returns the GetDlgItem(IDC_PLACEHOLDER) a valid pointer?
Also I missed a part of the code, after the sheet is created, you need to set it's size and position:
CRect rectPropSheet;
pwndPropSheetHolder->GetWindowRect(rectPropSheet);
m_sheet->SetWindowPos(NULL, 0, 0,
rectPropSheet.Width(), rectPropSheet.Height(),
SWP_NOZORDER | SWP_NOACTIVATE);
Pavel
Sonork 100.15206
|
|
|
|
|
Does anyone know how to simulate extended characters (128-255) with PostMessage (or SendMessage)? I guess I can do it using ALT key + number on numeric keypad
For a simple example, I did this:
<br />
PostMessage(::GetFocus(), WM_KEYDOWN , 0x12, 0x2038001);<br />
PostMessage(::GetFocus(), WM_KEYDOWN , 0x61, 0x204F001);<br />
PostMessage(::GetFocus(), WM_KEYUP , 0x61, 0xE04F001);<br />
PostMessage(::GetFocus(), WM_KEYUP , 0x12, 0xC038001);<br />
...to simulate ALT-1 (or any other numbers from 1-255 at numeric keypad..)
But it just outputs the actual number '1', so I guess it doesn't work that way?
|
|
|
|
|
Take a look at the MSDN docs for WM_SYSKEYDOWN - this is the message normally sent by windows when a key is pressed while Alt is down.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
I tried to play with WM_SYSKEYDOWN, but couldn't find out how to use it to simulate such a keystroke.
If anyone has an example, please let me know
Thanks
|
|
|
|
|
dear all
i want to encrypt and decrypt my passwords stored in ini files.
can someone point me a link to encryption/decryption.
is there a sample which shows same algorithm in vb as well as C++
to encrypt and decrypt strings.
thanx
|
|
|
|
|
|
I am curious if there is any way to determine the minimum and maximum fill points of the area filled by ExtFloodFill. I do not beleave there is, but if there is I would like to know. This knowlege would allow me to determine the area that needs to be invalidated. Otherwise I am stuct with invalidating the entire drawing area, which will slow redraw speed. Of cource the user might not notice, but I would.
------------------------------------
Trust in the code Luke. Yea right!
|
|
|
|
|
in my program,i want to add a function to shutdown the pc,my pc OS is win2000
my programming everioment is turbo c,cannot use mfc.
best regards.
|
|
|
|
|