|
is there a way to change values of domain users HKEY_CURRENT_USERS key on a particualr machine while that user is not logged on.
a programmer traped in a thugs body
|
|
|
|
|
How will the HKCU hive exist if there is no current user? Perhaps you'll want to update the HKU hive instead.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
If you have a local user its current user comes from one the HKU key. However we don't have roaming profiles in our environment but a domain user can log onto a machine make changes to his HKCU values and it is retained however if I'm logged on as an admin I can't find a key under HKU tat corresponds to that user.
a programmer traped in a thugs body
|
|
|
|
|
My guess is that the registry hive for the user on the domain is located on a server somewhere, in which case you need a remote registry connection and look for user profile on the domain controller or other system containing the information.
If a 'domain' user logs onto a local system and he has not been added to that local system explicitly, his prfile is probably temporary while he is logged in and thus not found within the registry of the current (local) system.
|
|
|
|
|
Take a look at the LoadUserProfile function.
The hProfile member of PROFILEINFO parameter is a registry key handle opened to the root of the user's hive
|
|
|
|
|
Can some one tell me how to add an entry to a string table. Is it as simple as inserting a String.I was looking at inserting IDS_ABC.
Thanks,
M
-- modified at 13:04 Tuesday 8th November, 2005
|
|
|
|
|
Well, you can edit the .rc and .h files manually, or you can do it via the IDE. Click the ResourceView tab on Workspace window. Right-click String Table and select Insert String Table from the context menu. Now in the right pane, either press the Insert key or right-click and select New String. Does that help?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thanks, That was what I was doing. Just wanted to be sure if it was done differently. Could you please explain the use of String table.
Thanks
M
|
|
|
|
|
TUMB wrote: Could you please explain the use of String table.
String resources are simply null-terminated Unicode strings that can be loaded when needed from the file. Using string literals instead would make your code harder to translate into other languages, plus it makes the memory footprint larger. String resources are not loaded into memory unless they are asked for.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I can use the 8 data lines of this port OK, but when it comes to using the other 4 output lines on the control section of the port I have no luck.
I keep getting 0x0C back when I read these lines (no matter what I set it to):-
Note Using PortTalk for Windows 2000:
Code:<br />
int ReadPortLPT1C(void)<br />
{<br />
int value = inportb(0x37a);<br />
return value;<br />
<br />
}<br />
<br />
void WritePortLPT1C(int newData)<br />
{<br />
outp(0x37a, newData);<br />
}
As I said it works fine for the data lines (8) at address 0x0378.
|
|
|
|
|
The control port on your PC may be a write only port and reading back the data from it would not be valid. You should check the lines with a scope and verify if they are toggling. If you ultimately require more read lines for your project you can add a latch circuit and use one of the control lines to swap your other signals to read from the 8 data lines.
|
|
|
|
|
|
Hi CPians,
following code does work:
BOOL b4=CreateDirectory("C:\\hop",NULL);
following does not work (I have deleted the hop previously created by the previous code line, so the start point is the same):
BOOL b4=CreateDirectory("C:\\hop\\hop\\hop",NULL);
GetLastError returns 3, which states "The system cannot find the path specified." which is in this especially true, since I would like to create the directory
Does CreateDirectory not support multiple level creation ? If not, are there any alternative solution to it ?
Do I have to use specific security attributes ? If yes, how can I retrieve them (like the ones currently set for the system) ?
Do you think following is possible with CreateDirectory :
BOOL b4=CreateDirectory("\\server.hop.com\\hop\\hop",NULL);
Thanks for all
~RaGE();
|
|
|
|
|
The documentation for CreateDirectory[^] does mention that it will only create the final directory in the specified path (c.f. the comments for ERROR_PATH_NOT_FOUND).
There is a suggestion at the MSDN site to use the SHCreateDirectoryEx function. However, the documentation for this function would indicate that it won't work on earlier versions of Windows.
The alternative is to parse your path string (for the '\\' or '/' characters) and create the intermediate directories as well. You can use CString to locate the first occurrence of the character, do a SetCurrentDirectory and, if that fails, CreateDirectory. Repeat this process until you've parsed all subdirectories in the path string.
Bob Ciora
|
|
|
|
|
I'm trying to get a textbox that I can immediately start typing into.
Currently, I have to click in the window before the cursor shows up then allowing me to enter text. Any suggestions? I've tried using ShowWindow(TEXTMOVE,SW_SHOW) and SetForegroundWindow(TEXTMOVE)and other things in my DoReturnStuff subroutine, but nothing has worked.
Attched is my code:
#include <windows.h>
#define WIN32_LEAN_AND_MEAN
#define DIRECTIONS 1000
#define TEXT_ENTRY 1001
#define ADD_BUTTON 1002
static HINSTANCE hInstance = NULL;
char szClassName[] = "iotest";
static HWND TEXTMOVE;
void DoReturnStuff()
{
UINT TextLength = GetWindowTextLength(TEXTMOVE);
LPTSTR ItemText = new TCHAR[TextLength + 1];
GetWindowText(TEXTMOVE, ItemText, TextLength + 1);
MessageBox(NULL, ItemText, "you pressed enter:", NULL);
SetWindowText(TEXTMOVE,NULL);//ERASES TEXT IN TEXTBOX
// ShowWindow(TEXTMOVE,SW_SHOW);//trying to make cursor appear
// SetForegroundWindow(TEXTMOVE);//trying to make cursor appear
delete[] ItemText;
return;
}
LRESULT CALLBACK inputoutput(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
switch(message){
case WM_CREATE:
CreateWindow("STATIC", "Enter text:",
WS_CHILD | WS_VISIBLE,
70, 20, 150, 20,hwnd, (HMENU)DIRECTIONS, hInstance, NULL);
CreateWindow("BUTTON","Add Name", WS_CHILD | WS_VISIBLE,
105, 90, 80, 30,hwnd, (HMENU)ADD_BUTTON,hInstance,NULL);
TEXTMOVE = CreateWindow("EDIT","enter key",WS_CHILD | WS_VISIBLE,
35, 50, 55, 100, hwnd, (HMENU)TEXT_ENTRY, hInstance, NULL);
SendDlgItemMessage(hwnd, TEXT_ENTRY, WM_SETFONT,
(WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0));
break;
case WM_COMMAND:
if(HIWORD(wParam) == BN_CLICKED){
if(LOWORD(wParam) == ADD_BUTTON){
DoReturnStuff(); } }
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, message, wParam, lParam);
break;
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdShow){
HWND hwnd;
MSG talkbacktome;
WNDCLASSEX usefulstuff;
usefulstuff.hInstance = hInstance;
usefulstuff.lpszClassName = szClassName;
usefulstuff.lpfnWndProc = inputoutput;
usefulstuff.style = CS_DBLCLKS;
usefulstuff.cbSize = sizeof(WNDCLASSEX);
usefulstuff.hIcon = LoadIcon(NULL, IDI_WINLOGO);
usefulstuff.hIconSm = LoadIcon(NULL, IDI_WINLOGO);
usefulstuff.hCursor = LoadCursor(NULL, IDC_ARROW);
usefulstuff.lpszMenuName = NULL;
usefulstuff.cbClsExtra = 0;
usefulstuff.cbWndExtra = 0;
usefulstuff.hbrBackground = (HBRUSH)COLOR_BTNSHADOW;
if(!RegisterClassEx(&usefulstuff)) return 0;
hwnd = CreateWindow(
szClassName,
"name sorting",
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,
CW_USEDEFAULT,
CW_USEDEFAULT,
275,
175,
HWND_DESKTOP,
NULL,
hInstance,
NULL
);
ShowWindow(hwnd, nCmdShow);
while(GetMessage(&talkbacktome, NULL, 0, 0))
{
// dante shamest cpp-home.com forum jun 10 2004
if ((talkbacktome.message==WM_KEYDOWN)&&(talkbacktome.wParam==VK_RETURN))
{
DoReturnStuff();
}
TranslateMessage(&talkbacktome);
DispatchMessage(&talkbacktome);
}
return talkbacktome.wParam;
}
|
|
|
|
|
You need to call SetFocus() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Simple question, easy answer, but so hard to find. Thank you
|
|
|
|
|
I am new into Bluetooth programming. I am trying to find out my bluetooth services. First I tried with SDP (WSALookupServiceBegin, WSALookupServiceNext) giving my own BT address, then realized that RFCOMM does not support loopback.
Now I am trying to find my BT Services in the Registry. Does anyboady know where should I search for services in the registry?
There are a couple of articles here @ codeproject that go into HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and display the services folders, e.g BthServ, but I am looking for the actual BT services.
In other words, I am looking for a result like this:
Result of SDP
Serieller Bluetooth-Anschluss
Netzwerkzugang
Netzwerkzugang
DFU-Netzwerk
PIM-ObjektUbertragung
DateiUbertragung
Fax
PIM-Synchronisation
Sync Command Service
Kopfhorer
Kopfhorer
Audio-Gateway
Bluetooth Imaging
(null)
that runs in my own machine.
I would really apreciate some help.
Thanks,
Christian
|
|
|
|
|
Hi all,
I have been developing php and VB.net apps for sometime now, and wish to start learning windows gui based C++ apps. Alot of tutorials seem to concentrate on console based C++ apps and I just wanted some advice on where is best to start. VS has such a wealth of different types of app that its quite confusing! Win32 Apps seem the way to go. If anyone could point me in the direction of a good place to learn how to build simple win32 apps (or books that are good?!) it would be most appreciated!
Many thanks
D
|
|
|
|
|
don't start with a "Win32" app. that's the low-level, old-school, messaqge-loop and Win32 API stuff.
i'd start with an MFC "Dialog App". MFC is much friendlier than Win32.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi Chris,
Thanks for the response.
I (very quickly) started an MFC project. The default gui had default icons like that of mfc based wordpad. Can you build applications that do not contain these defaults?
Without asking to much of you, are there any disadvantages of using MFC over Win32 api. I have yet to find a good explanation of which is good / bad etc.
Many thanks
Dave
|
|
|
|
|
Hello,
If you start the wizard for a new MFC project, you can select different kinds of options all the time. If I remember correctly, It's the second dialog where you can select if you want a dialog based application, and SDI or MDI application. You selected SDI (the default) and the results is the default implementation to get you started. (With pure WIN32 it would have taken you a few days to get it!)
You should select the dialog based option to get the forms you want.
Good luck.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
(i assume you're using VS'03)
start a new MFC project. in the Application Type tab, choose dialog. the "Wordpad" stuff is probably an SDI (Single Document Interface) app. that's a bit more complicated that a dialog app, if you're new to MFC. once you have your blank dialog, you can drop controls onto it and play with messages kindof like you do in VB.
if you use the Win32 API, you're going to have to get intimately familiar with Windows' message passing and handling. these days, the only real benefit from a Win32 app over an MFC app is that the Win32 app won't require MFC (which adds size to the EXE - roughly 200K for a dialog app - no big deal). other than that, MFC is the way to go.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi again.
Thanks very much for the responses. I understand alot more now. MFC looks like the way to go then
I am sure I will be back shortly with MFC related questions In the meantime thanks everyone for the feedback.
Dave
|
|
|
|
|
I learned the basics at functionx.com, more specifically in their Visual C++ section. Start looking under the "How-To" section on the right side. They teach you how to create a project, create dialog boxes, call them in the code when you press a button, transfer information from the dialog box back to the program, etc... Once you understand that, then you can look to the left side under "Windows Controls" and learn how each standard windows control works. The "MFC Fundamentals" above it is also very helpful to learn next. If you understand all of that, then you can understand all the articles here and can begin work.
The biggest hurdle programmers have (and that I had) is first, understanding that with console apps, the programmer guides the action completely. In MFC applications, the mechanics of the program are already written for you when the AppWizard creates your project, but you, the programmer, need to program what should be done when certain events occur.
For example, if you create a button and add an event handler, Visual Studio will change the mechanics of your project and add a function that will be run when the button is pressed. All you have to do is to write code in that function that should be run when the button is pressed.
I learned MFC basics on functionx.com but I came here because there's much more information but it's only useful if you are somewhat familiar with MFC. Good luck in your studies.
|
|
|
|
|