|
One of our customers is going to translate the Windows application that we have written for him. The easiest way to achieve this would be for me to send him the resource file. Once translated, I would only have to rebuild the application using this file.
Unfortunately, most of our customers do not have the Visual Studio installed, nor has this customer. Does anyone know a standalone application (preferabely freeware) that would allow one to edit resource (.rc) files in a similar way as in Visual Studio?
|
|
|
|
|
You can directly edit the resources in binaries with VC on NT. Assuming your customer has VC and NT, of course. That way you don't have to rebuild anything.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Another option is to use a program such as ResHacker, which allows you to modify the resources without Visual Studio. It should be avaliable at:
|
|
|
|
|
Sorry, let me try that address again:
http://rpi.net.au/~ajohnson/resourcehacker/
The rest of my message mentioned the Win32 API functions you can use to modify the resources of a binary file at runtime:
BeginUpdateResource
EndUpdateResource
The only problem with these is that the format of the String Table is anything but easy to work out. I certainly couldn't find any documentation for it!
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
I have an app that uses a hosted browser control (IE control) to print using print templates. I would like to pragmatically change the destination printer because currently I'm limited to always printing to the default printer set for IE. So far all of my research has turned up empty. According to MSDN it seems that due to security reason you can't change the printer.
My app is written in VC++ and is hosting the browser control that I'm using to print. If any one has some suggestions on how I can pragmatically change the print I would appreciate the help.
Seems that this is one feature MS overlooked that is really needed if they want you to reuse the browser control in your own apps.
Hawkins
|
|
|
|
|
Hi all,
I'm looking for a function to check wheather a given NT account (not the current!!) has administrator rights.
Has anybody things like that in the pocket?
Best regards,
Jo
|
|
|
|
|
Have a look at the netapi.
Isac
|
|
|
|
|
Hello Johannes,
The following sample code may help you :
#include <windows.h>
#include <lmerr.h>
#include <lmaccess.h>
#include <lmapibuf.h>
void main()
{
WCHAR wszServer[] = L"\\\\server_name";
WCHAR wszUserName[] = L"user_name";
NET_API_STATUS net_api_status = 0;
GROUP_USERS_INFO_0* pgroup_users_info_0 = NULL;
USER_INFO_2* puser_info_2 = NULL;
DWORD dwentriesread = 0;
DWORD dwtotalentries = 0;
net_api_status = NetUserGetGroups
(
(LPWSTR)wszServer,
(LPWSTR)wszUserName,
(DWORD)0,
(LPBYTE *)&pgroup_users_info_0,
(DWORD)8096,
(LPDWORD)&dwentriesread,
(LPDWORD)&dwtotalentries
);
net_api_status = NetUserGetInfo
(
(LPWSTR)wszServer,
(LPWSTR)wszUserName,
(DWORD)2,
(LPBYTE *)&puser_info_2
);
if (pgroup_users_info_0)
{
NetApiBufferFree (pgroup_users_info_0);
pgroup_users_info_0 = NULL;
}
if (puser_info_2)
{
NetApiBufferFree (puser_info_2);
puser_info_2 = NULL;
}
}
The following is a summary :
1. NetUserGetInfo()
1.1 This API will return to you a USER_INFO_2 struct in which the "usri2_priv" field (type DWORD) contains one of the following values :
1.1.1 USER_PRIV_GUEST
1.1.2 USER_PRIV_USER
1.1.3 USER_PRIV_ADMIN
If USER_PRIV_ADMIN is returned, this indicates that the user has Administrator rights.
1.2 When you no longer need this USER_INFO_2 struct, call NetApiBufferFree() to free the memory for it.
2. NetUserGetGroups()
2.1. The motivation behind the use of this API is to get a list of Groups to which a user belongs and then check to see if one of these groups is "Administrators".
2.2. The NetUserGetGroups() API will return to you an array of GROUP_USERS_INFO_0 structs. Each element of the array contains a pointer to a Unicode string which is the name of a Group to which the user belongs. The last two parameters "entriesread" and "totalentries" will help to indicate to you how many elements were returned in the array.
2.3. However, I found this API a little strange in the sense that the "Administrators" group does not seem to be used.
2.4 When I specified "Administrator" as the user name, NetUserGetGroups() returns "None" as the group name.
2.5 However, you can use this API to obtain a list of Groups to which a User belongs.
2.6 Like NetUserGetInfo(), you need to delete the array of GROUP_USERS_INFO_0 structs by calling NetApiBufferFree().
Hope the above will help you, Johannes. Best of luck.
Regards,
Bio.
|
|
|
|
|
Bio,
thank you very much for your detailed contribution!
I have one more question about your solution:
Does NetUserGetInfo() return USER_PRIV_ADMIN if the user is member of the "Administrators" group or do I always need to search the groups returned by NetUserGetGroups?
I would like to avoid using NetUserGetGroups, because my problem with searching the groups is, that we are running in several language environments. So the group "Administrators" reads "Administratoren" on a german system. And we support more languages than those two.
Again,
thanks a lot!
Jo
|
|
|
|
|
Hello Johannes,
You're most welcome, Johannes. About your question : Yes, NetUserGetInfo() will return USER_PRIV_ADMIN if the user is a member of the "Administrator" group. The user may belong to several groups but as long as he/she is part of the Administrator's group, USER_PRIV_ADMIN will be returned.
I understand your concerns over the use of NetUserGetGroups(). If detecting Administrator rights or being part of the Administrator's Group is all that is needed, I would vote for NetUserGetInfo().
Regards,
Bio.
|
|
|
|
|
Hello Johannes,
I have another suggestion for you. There are three other functions that you can use : NetLocalGroupEnum(), LookupAccountName() and NetLocalGroupGetMembers().
1. The NetLocalGroupEnum() API retrieves information about each local group account on a target machine. It returns the group information in an array of LOCALGROUP_INFO_0 structs.
2. You can then iterate through this array and call LookupAccountName() on each group name. You will be returned an SID for that group account.
3. Now, the important part of this suggestion is the fact that NT uses a constant SID value for some well-known accounts like EVERYONE or WORLD. I'm very sure that the "Administrators" group account is also one of these well-known Group Accounts.
4. The SID string for the "Administrators" group should be "S-1-5-32-544" on all NT systems. Please verify this, Johannes, before using my suggestion.
5. Now, once you have found the "Administrators" Group Account, call NetLocalGroupGetMembers() to get an array of LOCALGROUP_MEMBERS_INFO_1 structs. Each element of the array will contain information on the User Accounts that are part of the given Group Account name.
6. You can use this method to obtain the list of User Accounts which are part of the "Administrators" Group Account on a machine. The wonderful thing about these APIs is that you can make these queries on any machine not just the local machine.
7. I have previously written an article in CodeProject with sample code and demo program that closely matches the details above. My sample program collects NT Remote and Local Group and User Account SIDs and store them in an INI and an XML file. You can run my app and collect these SID info at a later time by accessing the information in the output INI file or the XML file.
8. The following is the link to my article :
http://www.codeproject.com/useritems/collectsid.asp
You can also search for it under "Free Programming Tools" section of CodeProject.
9. I'd also like to refer you to a great article by Mark Russinovich (of SysInternals) where he gave a very good introduction to WinNT Security :
http://www.winntmag.com/Articles/Index.cfm?ArticleID=3143&pg=1
In this article he also mentions some good points about SIDs and the existence of "well-known" or "built-in" SIDs.
10. I hope the above info will help you further, Johannes. Best of luck.
Regards,
Bio.
|
|
|
|
|
In a streaming application which would seem the better, TCP or Unicast UDP? Which has less overhead, reliablity, etc. Any help would be greatly appreciated.
Stephen Caldwell
Blackfission, CEO
http://bf.steffc.yi.org:81
Sonork ID: 100.10100
|
|
|
|
|
Anyone have a CStatic control that has scrollbars? I could use CEdit with read-only, but it does not look very good on PocketPC.
|
|
|
|
|
I wanted to monitor the number of upload and download bits, in realtime, under Windows 98 and 2000. Does anyone have any idea of doing it? I would be doing it under VC++.
Many ThanXs...
|
|
|
|
|
Can anyone roughly tell me how i can send AT commands through a palm with CodeWarrior program.I have succesfully open the serial port for transmitting data but there's error when sending out AT commands.I use the hyper terminal to check my output data but it does not coincide with the input data.
|
|
|
|
|
Hello,
in my MFC app I'm using a modeless child dialog to display some extra information. When the input focus is on the modeless dlg, the accelerators of the main app are not working.
What to I do to make things better?
Thomas
|
|
|
|
|
I'm looking for a easy way to skin an MFC app(captions, buttons, progress bars, windows and dialogs borders, etc), does anybody know where can i get an example of this, or if you're gonna put an article about this?
|
|
|
|
|
Anyone seen some code that does VC.NET auto hide windows in MFC (I found one in WTL (http://home.worldonline.dk/~viksoe/autohide.htm) but that doesn't fit my current project))
Thanks
|
|
|
|
|
Wait for BCG pro
Le Ridder Noir
Considderd to be the worlds fastest knoppenbonker.
one year of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru and Crystal Ace.
|
|
|
|
|
I think you're missing the point. The whole point of this site is to share source code with each other. Recommending a commercial library doesn't answer the original poster's question. Get a clue Troll.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
I looking for a sample source code for simple transmit/recieve audio/video in c++.
I currently using the JMF but i want to have "Control".
Does somehting like this exist?Where can i find Source and documantion and samples.
Hope to have an answer.
Yoav:
yoav adler
|
|
|
|
|
Try
http://www.banasoft.com/AVPhone.htm
|
|
|
|
|
I looking for a sample source code for simple transmit/recieve audio/video in c++.
I currently using the JMF but i want to have "Control".
Does somehting like this exist?Where can i find Source and documantion and samples.
Hope to have an answer.
Yoav
|
|
|
|
|
Hi, all!
Does anyone of you know how to apply C++ to program an algorithm named "Subspace iteration", which is mainly for the calculation of eigenvalues and eigenvectors.
Thank you very much for your guidance!
Jeffrey
|
|
|
|
|
How can I find out what OS my program is running under. I need to be able to distinguish between NT 4.0 and Win 2K.
Regards,
SAK
|
|
|
|