|
Does anyone know of a Windows Common dialog, or standardized way to display the user accounts on a Windows NT machine, so that a user can select permissions and such?
|
|
|
|
|
There is a standardized way to display this information, its called the User Manager. Do you really want to expose this to ordinary users? I would leave it up the administrator to assign rights and permissions.
|
|
|
|
|
In the registration process of this program Im working on, I would like to have it a dialog box where I (the administrator) can enter the username and password that the server will run under (yes I could do this in dcomcnfg, but I would like to put that functionality in my program as well). And while the user manager is a good way to display this information, I cannot get data selected from the user manager into my project, which is what I want. The "Browse for user" dialog box presented in dcomcnfg is the same dialog that is presented when you set the permissions on a file or folder, which is why I thought it might be a standard dialog box...That is that dialog box I would like to put up, and if theres a standard way to do it that would be best =)
|
|
|
|
|
Use Net* and Lsa* functions. For example NetUserEnum, NetUserChangePassword, LsaEnumerateAccountRights ... and many many other.;)
|
|
|
|
|
Sweet thanks...the Net* functions answer most of my question. Do you know if there is a way to bring up that seemingly standard "Add Users/Groups" dialog, with the combo box at the top, and the list box to display the users/groups? Ive seen the identical dialog box both in windows, and on separate applications, so I assume its standard in some way...
Thanks again
|
|
|
|
|
I have a sdi formview based app, and when the main form resizes, I want my listbox (which takes up the entire form) to resize with it. I tried overriding WM_SIZE, but it won't let me use...
m_ctrlListBox.SetWindowPos()
or
m_ctrlListBox.MoveWindow()
It crashes in both functions on ASSERT(::IsWindow(m_hWnd));
How else would I resize it?
|
|
|
|
|
The problem is that the HWNDs aren't associated with your member variables until after the window is created, but the form receives a resize before this association. Another WM_SIZE is sent after creation, so the easiest way to fix this problem is:
CSomeClass::OnSize(....)
{
if (m_ctrlListBox.GetSafeHwnd() != NULL)
{
m_ctrlListBox.MoveWindow(....);
}
}
See how that goes. Hope it helps!
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Ok here's what I have now. It doesn't crash, but it doesn't resize either. The debugger shows it gets into the if statement, and the coordinates seem correct. Maybe when I call UpdateWindow() it redraws the listbox from the dialog template, intead of the new resized listbox.
void CMyView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
if( m_ctrlListBox.GetSafeHwnd() != NULL )
{
CRect rectWindow;
GetWindowRect(rectWindow);
m_ctrlListBox.SetWindowPos(&CWnd::wndTopMost, rectWindow.left, rectWindow.top, cx, cy, NULL);
UpdateWindow();
}
}
Any Ideas?
|
|
|
|
|
OK, I tried creating a dummy SDI app, added my Listbox, and created a CListbox control for it. Here's my OnSize handler, which seems to work just fine:
void CTestSDIView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
if (m_ctrlListbox.GetSafeHwnd())
{
m_ctrlListbox.MoveWindow(0, 0, cx, cy, TRUE);
}
}
I also thought it may have to do with the subtle difference between UpdateWindow() and Invalidate(), but that didn't seem to fix your code. I guess that's why I always try and use MoveWindow where possible! Note that MoveWindow coordinates are client coordinates relative to the parent FormView, hence the 0, 0 top left coordinates.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
|
SendMessage(hwnd, WM_LBUTTONDOWN, (WPARAM)(fill this out, use your help),(LPARAM)(same here..));
Piece of cake.
|
|
|
|
|
You want to send a message? How about the apply named SendMessage function?
SendMessage(hWnd, WM_LBUTTONDOWN, 0, 0 ), Doh!
|
|
|
|
|
|
I think it's the only way so try again
|
|
|
|
|
Since you didn't get this answered, what seems to be the problem??
Is the hWnd parameter the button you are trying to invoke? Perhaps you could post the problem code so it can be ignored.
|
|
|
|
|
|
One possible way is using API mouse_event
::mouse_event ( MOUSEEVENTF_LEFTDOWN , mouseX , mouseY , NULL , NULL )
look in MSDN for full description of MouseX , MouseY .
|
|
|
|
|
I have a template which should take any type of input such as int, float, or string and return a value.
template<typename T> void GetParmValue(T& value)
{
std::string& str = GetSomeString();
std::istringstream iss(str);
iss >> value;
}
If value is of type std::string then istringstream only gives me the first part of the string. It's spliting the string at the white space.
For instance:
std::string value;
std::istringstream iss("Test 123");
iss >> value;
value is now "Test" and not "Test 123".
Any ideas on how to get around this?
|
|
|
|
|
You'll have to use the getline() function to get the compleate string.
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
You have to specialize your template like this:
template<> GetParmValue(std::string& value)
{
std::string& str = GetSomeString();
value=str;
}
Let us know if that fixed your problem
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Can someone show/teach me the script for imitating keyboard input. I want to make a loop that simulates someone inputing Alt+"C", [five second pause], "pepper", [five second pause], Tab, [five second pause], "mint", [five second pause], Enter, [five second pause], Alt+A. Someone plz help me?!?!?!?!
|
|
|
|
|
Use the SetTimer function to time the messages; use the OnChar message to send character messages.
It would be something like this:
CView::MyFunction()
{
SetTimer(ID_TIMER1, 5000, NULL); //You can use a callback function if you like
SetTime(..);//etc.
}
CView::OnTimer() //classwizard generated.. you wouldn't use this function if you use a callback function.
{
if (blabla..)
{
blabla..
}
}
CView::Onchar(blabla etc..) //classwizard generated function
{
swith (nChar)
case ??: //change this
{
//and this..
}
case ??:
{
etc..
}
}
|
|
|
|
|
I have only taken a year long course using C/C++ so I am a newbie. I was using the metrowerks compiler but I just got Visual C++. If it is not too much trouble. It would be very helpful if you could write out all the code. That would be the greatest. Thanx.
|
|
|
|
|
Hey Folks,
With all this talk of privacy and various registration schemes which are required with WinXP, do you think when you compile an application it stores anything about your PC (Mac Address, Disk Serial) in the actual EXE?
I read somewhere, and proved it with a hex editor, that a document created by word actually contains the MAC address of your network card.
Any comments?
Do you think MS stores the VC serial number in the exe?
Anyone have any code?
Mike.
|
|
|
|
|
Thats a good question for "The Lounge" I bet you'd get a lot more responses too.
|
|
|
|