|
YOu can do this, but it's a little ugly. How I managed to do this was:
Get security settings of the key I'd like to emulate (e.g., HKLM\Software)
Set security settings on my new key to the settings I just got.
Check out RegGetKeySecurity and RegSetKeySecurity and that should put you in the right direction.
No generalization is 100% true.
Not even this one.
|
|
|
|
|
The Problem is that I'm NOT allowed to change the software who is creating that new
subkey so it would set the security settings by it's own like that.
Grit
|
|
|
|
|
Hi! Could somebody tell me how can i access the properties of standard C++ and additional AciveX controls?
I used VB before C and i was used to get/set a property using a simple command like (TextBox1.Text="Anything or else"'. But in C++ i cannot do this so simple. I tried to add a member variable (using the class wizard) for a CString type value(m_Text1) and for the control(Text1) either but they just don't work. The CString shows no connection between it and the value (it's always empty), and when i try to use the var. for the control (Text1.GetWindowText and Text1.GetLine) it says: unhandled error at 0x0000005?).
Please somebodi tell me the solution! Thanks!
Vis
|
|
|
|
|
OK, I will have a stab at this. Even though I have been drinking beer and haven't written any code in close to 6 months due to no job and to much reading and looking after kids.
Let's say you have a control called Ctrl1, you set the text using Ctrl1.SetWindowText("NewTitle") and retrieve the current value using Ctrl1.GetWindowText(StrToStore).
I hope that is what you were asking.
Michael Martin
Australia
mjm68@tpg.com.au
"He orginally got the Tweezers of Destruction through the scanners but then popped back outside for a smoke."
- Chris Maunder 26/03/2002
|
|
|
|
|
take a look at "UpdateData()"
it tranfers the text from the controls to the CString or from the CString to the controls
if very easy to use when you have many control in one dialog
you can also use the "SetWindowText" and the "GetWindowText" but you will have to write more code to get the same thing done
|
|
|
|
|
the problem is that;
you tried to access a CString type EditBox variable as if u are using a CEdit (control type) variable. GetWindowText and GetLine is available for control type variables. You can use the value whatever u write in EditBox inside your code easily getting the value (be it character or number) by UpdateData(TRUE); or display the new value (if u changed it inside ur code) by UpdateDate(FALSE)...
Visual C++ is not a toy..you will understand me in the future...
just listening to you...
|
|
|
|
|
I've got a modeless dialog box which can be resized and I would like to set a minumum size for it, as it looks stupid if it is too small. Any ideas?
I tried editing the OnSize function like this (thinking that if it worked I could check for 'cx < MINIMUM_X' and change cx if required):-
void CDlg::OnSize(UINT nType, int cx, int cy)
{
cx = 200;
cy = 300;
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
}
It didn't work, the dialog stayed the same size. And when I looked at cx and cy in the debugger their values did not change (they were 605 & 573 when it entered the function and the same when CDialog::OnSize was called). I am very confused about why they did not change . Can anyone help?
Any comments welcome .
ali p
|
|
|
|
|
Check out WM_GETMINMAXINFO . This will let you set min and max sizes for your dialog.
|
|
|
|
|
Thanks you for your reply.
I added a message handler for WM_GETMINMAXINFO to CMainFrame and that worked fine .
BUT i wanted to set the minimum size for a Dialog box and when I go to add a 'New Windows Mesage Event' for for the dialog box, WM_GETMINMAXINFO is not on the list . Any ideas?
ali p
|
|
|
|
|
Yeah, that's a design flaw in VC++. You have to go to the last page of the class wizard - can't remember what it's called, alas, I've moved to VC7 and ClassWizard is gone - and then there's a silly little combo box labeled "class type" or something like that. Change it from "dialog" to "window" and all of the messages will be availale.
|
|
|
|
|
Jim A. Johnson wrote:
I've moved to VC7 and ClassWizard is gone
Ya, I looked for ever to find where to enter in OnPaint() handler for My dialog class. I would have added a menu for a Message handler dialog box when you right click the Class in the solution explorer like VC++6.0 had like the Project(I can't rememeber what the tab name is) window.
Real World Coding:
POP& BuyAPop(Money ADollar){...};
|
|
|
|
|
i have three question :
1.Popup menu system on windows' desktop.
2.windows accept drag an drop.
3.move an item on a popup menu to another position.
if you can help me or have the source code that send a message to me!!
|
|
|
|
|
Hi All,
I have a resource bitmap and I could show it.
By the following line I could get a handle to it.
/*----------------------------------------------------------*/
hBit = LoadBitmap( hInst, "LASER");
/*----------------------------------------------------------*/
I also attach the hBit handle to a CBitmap object then use GetBitmap funtion to have a BITMAP variable.
now I wan to show this bitmap by only it is Red pixel values.
for exmaple:
if the RGB value of an pixel is 0x4f1254
I only what to get a new bitmap with the 0x4f0000 value of the same pixel.
How could I do it.
karanba
|
|
|
|
|
You may be able to do something fancy with raster operations, but I think it's more likely you'll need to grab a DIBSection wrapper and do something like the colour filter in my first image filtering article. The code is in C#, but it's easily ported.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Hi Christian
I see the article below.
Image Processing for Dummies with C# and GDI+ Part 1 - Per Pixel Filters
I have a BITMAP variable that has been attached to my bitmap file. and I need an array but what must its dimensions.
I can get the folowing values for my bitmap;
------------------------------------------------------------------------------
bmType
Specifies the bitmap type. This member must be zero.
bmWidth
Specifies the width, in pixels, of the bitmap. The width must be greater
than zero.
bmHeight
Specifies the height, in pixels, of the bitmap. The height must be greater
than zero.
bmWidthBytes
Specifies the number of bytes in each scan line. This value must be
divisible by 2, because the system assumes that the bit values of a bitmap
form an array that is word aligned.
bmPlanes
Specifies the count of color planes.
bmBitsPixel
Specifies the number of bits required to indicate the color of a pixel.
bmBits
Pointer to the location of the bit values for the bitmap. The bmBits member
must be a long pointer to an array of character (1-byte) values.
------------------------------------------------------------------------------
karanba
|
|
|
|
|
I dunno if bmBits will work if it's not a DIBSection, but if it does, that's your baby. You want to iterate through the bits then and make the first two of every group of four ( assuming 32 bpp ) equal to 00 and you'll end up with just red ( they are stored BGRA ). If it's 24 bit then you've got some work ahead of you in calculating the stride ( the padding at the end of each line ), you need to figure out a stride value so the width of a line is divisable by 4. If it's 16 bit, you've got a *ton* of work, because you need to bit shift the values to get out your colours. Finally, if it's less that that you need to walk to palette instead of the bitmap.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Hi,
I have two Dialog boxes, Dialog1 and Dialog2.
I need to populate a Combo Box in Dialog2 from Dialog1.
When I use the following lines in Dialog1 it compiles without error.
CDialog2 ob;
ob.m_cComboBox.ResetContent();
However when I run it (and when it reaches the 2nd line above)I get a Debug Assertion Failure in File: afxwin2.inl at line 741 which is this line.
{ ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_RESETCONTENT, 0, 0); }
The Combo Box properties are, Type: Dropdown, Owner draw: Variable
Thanks in advance for any help,
Aoife
|
|
|
|
|
chk whether both dialog boxes r created. looks like one dialog is not created and the other is trying to fill the combo box of that uncreated dialog
|
|
|
|
|
Aoife wrote:
CDialog2 ob;
ob.m_cComboBox.ResetContent();
This will naturally cause problems. The MFC object has been created. But the window it wraps has not been created yet [in this case, it's the dialog window]
Do this instead. Use DoModal to bring up the dialog and put the combo box reset line in it's OnInitDialog function.
Regards
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
Thanks but that isn't going to be much good to me because later in Dialog1 I need to .AddString() to the ComboBox.
I guess what I'll have to do is write the items that need to be put into the ComboBox to a file in Dialog1 and then read them from the file when Dialog2 is opened and put them into the ComboBox.
Thanks for your help anyway.
Aoife
|
|
|
|
|
...or use a CStringArray member in Dialog2, which you fill from dlg1. In Dialog2::OnInitDialog, fill your combo from the array.
|
|
|
|
|
Hi,
I want to learn Device Drivers under Windows..
I know DDK is used.. Can neone tell me what should
i start with.. I mean the simplest driver of all.
Please provide some resources also.
Thanx
Sameer
|
|
|
|
|
That is probably the RAW print driver.
Happy programming!!
|
|
|
|
|
I use WebBrowser ActiveX Control in simple dialog based application, and I want to ensure, that this control is installed on user's system. I tried to handle CDialog::DoModal return value (-1 if unable to create the dialog), but some strange thing happens... After failing dialog creating MessageBox() doesn't dispalyed (sorry, if my english is wrong). I can't understand the reason, may be there are some other simple methods to detect that IE ActiveX presents?
|
|
|
|
|
Check the registry - IE stores it's version there, something like HKLM/software/Microsoft/IE/versions.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|