|
Hi,
Can someone tell the how I can get the list of all the users on the machine
for win95-xp.
I need something like function GetUserName, //which gives the name of current logged user
Thanks
Sansky
|
|
|
|
|
Here is its path in registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DocFolderPaths
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi,
Sorry, could not locate reg entry in w2k
Regrds,
Sansky
|
|
|
|
|
GetUserName returns the current user or you want to know the users that are using your resources?
Reagars,
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
GetUserName returns the current user or you want to know the users that are using your resources?
Regards,
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi,
Thanks for showing interest.
What I need is , all the users that have account on that machine.
Suppose machine A has existing users: UserA , UserB, UserC
machine B has existing users: Albert , Bill , Chris
then I want to see the list
machine A : UserA , UserB, UserC
machine B : Albert , Bill , Chris
Thanks
Sansky
|
|
|
|
|
Check in one of my Articles here . The Article is for NT but easyly you can make some changes for use the function that enum the user over win 95 or win 98...
You need to use the NetWkstaUserEnum function, but the problem is that any of thouse functions are no compatible whit win95....
Regards!!!;)
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
The idea of using Add-ins is realy cool. However, there's no ready made functionality to support it in MFC (as far as I know). So, does anyone happens to know where could I find a ready-made code framework for an application which knows how to load and use Add-ins ?
|
|
|
|
|
This link for an artical of mine shows the basics of how to use DLL add-in documents from a DLL. Its a good starting point for what you want to do.
http://www.codeproject.com/docview/docviewfromdll.asp
I dont know of an artical which covers add-ins in more depth as these add-in API's tend to be application specific.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
I need to implement support for the Visual Styles of XP in some application. It's not based on MFC, just pure win32 api is used. The main window of this application has a toolbar which is "hand made" too.
The problem is that Visual Styles API does not draw the bitmap of the toolbutton or makes it terrrible - draws the bitmap without tacking in account the transparency color...
Please help, here's that simplified code (for better readability) for each button on the toolbar:
HTHEME hTheme = GetToolbarHTheme(hwnd);
BITMAP bm;
COLORREF cl = MGetBitmapInfo(hBitmap, bm, -1, -1); // gets the dimentions and the transparency color of the bitmap
HIMAGELIST himl = ImageList_Create(
bm.bmWidth, bm.bmHeight, ILC_COLORDDB|ILC_MASK, 0, 2);
int i = ImageList_AddMasked(himl, hBitmap, cl);
DrawThemeBackground(hTheme, hdc, 1, state, &rect, 0);
DrawThemeIcon(hTheme, hdc, 1, state, (LPRECT)&rc (LPRECT)ptbi, himl, i);
ImageList_Destroy(himl);
CloseThemeData(hTheme);
when I remove "ILC_MASK" then the bitmaps are drawn in th black rectangles or
else nothing appeares
konst
|
|
|
|
|
I have to assume that the function "GetToolbarHTheme" is something that you wrote, because that is not a part of the Visual Theme API. I am on a Windows 2000 computer at the moment, so I have no way if the following code will work, but the way I would approach the problem is something like this:
PAINTSTRUCT ps;
BeginPaint( hWnd, &ps );
HTHEME hTheme = OpenThemeData( hWnd, L"TOOLBAR" );
DrawThemeParentBackground( hWnd, ps.hdc, ps.rcPaint );
DrawThemeBackground( hTheme, ps.hdc, TP_BUTTON, TS_NORMAL, &ps.rcPaint, 0 );
DrawThemeIcon( hTheme, rc.hdc, TP_BUTTON, TS_NORMAL, &ps.rcPaint, himl, i );
EndPaint( hWnd, &ps );
I would also recommend creating the image list once, instead of creating it and destroying it every time you draw a button. That will allow you to preload the images, create different lists for different button states, etc. Also, you should use the defined constants (TP_BUTTON, etc.) instead of hard-coding the numbers into your function calls.
If at all possible, use the new Windows XP true-color icons. These icons have 32-bits per pixel, with 8-bits per channel, including the alpha channel. You can specify any pixel to be transparent this way. Image lists do support this in XP, so there's no reason not to use them.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
Thank you for your answer, Paul.
But I wanted to ask something different.
This function
DrawThemeIcon( hTheme, rc.hdc, TP_BUTTON, TS_NORMAL, &ps.rcPaint, himl, i );
behaves wrong in my hands it draws nothing or bitmaps without transparency at all
and my question is what am I doing wrong with that image list or "DrawThemeIcon"
konst
|
|
|
|
|
Then, I think you will probably want to investigate the new true-color icons that were introduced with Windows XP. Not only are they true color, but they support a full 8-bit alpha channel for transparancy. An image list composed of these may work better, but I do not know for sure.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
Why when I click VK_DOWN or VK_UP ... (when my control has focus - control derived from CWnd). Control lost focus and next control get focus ?
Control doest never reveive VK_DOWN
Creating code :
dlg_table.Create(NULL,"Table",WS_CHILD | WS_VISIBLE, CRect(0,0,210,20),this,1001);
|
|
|
|
|
That window needs to respond to the WM_GETDLGCODE message. The DLGC_WANTARROWS flag will let the dialog message loop know you want the arrow keys.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
How can I access MainFrame from my view?
GetActiveFrame doesnt work.
|
|
|
|
|
GetParentFrame()
Michael
|
|
|
|
|
Try this:
(CMainFrame*)(AfxGetMainWnd())
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi,
I've created my ATL object, with one dual interface, and one custom interface, I have no problem accessing to the dual one, but to the custo, I cannot have access ( in the MFC application, using Smart pointers).
Does Smart pointer didn´t work with custom interfaces ?????
Thanks, Bye !
Braulio
|
|
|
|
|
They do work - what kind of Smart Pointers do you use?
(ComPtr, _com_ptr_t, or the MFC stuff? I usually use #import and the the _com_ptr_t ones - they are great...)
|
|
|
|
|
Hi !
I´m using the "#import" thing, and CComPtr, it´s quite amazing because I can declare the pointer, and the compiler won´t complain, but when I try to get my interface, it returns NULL, altough I've declared it in the interface map.
Thanks for your help, Bye !
Braulio
|
|
|
|
|
Whar error code is returned?
Is it an out-of-apartment component? In this case, the Proxy/Stub DLL might be missing / not registered.
Peter
|
|
|
|
|
Hi,
It´s an InProc, but I´m calling the ActiveX from an automated version from Word so it would be something like:
MyApp ( making calls to the controls)
---------------------------- Different Space Process
Word Instance ( Automated)
My Control DLL
Maybe it can be that the Word automated instance only can work with IDispatch interfaces ?
Thanks for your help, Bye !
Braulio
|
|
|
|
|
The (or at least: one) problem is to marshaling you custom interface across the Process Boundary.
For Dispatch interfaces, this is automatic (since the data types are limited and passed with function calls).
For custom interfaces, you need to build & register a proxy/stub DLL. ATL generates a makefile <projectname>_ps.mak, that which can be used to build the proxy/stub DLL automatically. (It uses the output of the MIDL compiler, so first compile the "normal" project, then the proxy/stub). The resulting DLL must be registered using regsvr32. Then, try again
-----------
how marshaling works: on the client side, the component's interface is silently replaced by a stub, which implements the required interface, but does nothing than pack the parameters in some marshaling stream and passes this to the proxy.
The proxy is loaded into the server apartment, unpacks the parameters, calls the actual method, packs the result(s) into a stream, and returns this to the stub.
The stub unpacks everything, and returns to the caller.
Not surprisingly, Proxy & Stub are implemented as COM components - in the proxy/stub DLL (it needs to be a DLL so it can be loaded into any process).
When building an ATL DLL server, you can also choose the merge the proxy/stub code into the DLL.
Hope this helps
Peter
|
|
|
|
|
Thanks !
Just one question, where can I see if my current project have that option checked ( the "merge the proxy/stub code into the DLL"), I can see it in the wizard when you create a project, but I don´t find the checkbox for a current created project ( or the file entry).
Thanks again for your help, greetings !
Braulio
|
|
|
|
|