|
This is an examle code that should load russian version of menu resource, but the main
window displayed with english UI though.
------------- sh ./eg.sh ------------------
#!/bin/sh
cat > generic.c << EOF
#include <windows.h>
#include <tchar.h>
#include <windowsx.h>
#define NAMESTART 16
WNDPROC Listbox_WindowProc;
BOOL CALLBACK Enumres_EnumProc(HMODULE hModule, \
LPCTSTR lpszType, LPCTSTR lpszName, LANGID wIDLanguage, LPARAM lParam)
{
TCHAR szItemText[NAMESTART + MAX_PATH];
HWND* hwnd = (HWND*) lParam;
wsprintf(szItemText, TEXT("%#03x %#03x - "), PRIMARYLANGID(wIDLanguage), SUBLANGID(wIDLanguage));
if (0 < GetModuleFileName(hModule, &szItemText[lstrlen(szItemText)], MAX_PATH))
{
ListBox_AddString(*hwnd, szItemText);
}
return (GetLastError() == ERROR_SUCCESS? TRUE: FALSE);
}
void Enumres_OnDestroy(HWND hwnd)
{
SetWindowLong(hwnd, GWL_WNDPROC, (LONG) Listbox_WindowProc);
PostQuitMessage(0);
}
LRESULT CALLBACK Enumres_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_DESTROY:
HANDLE_WM_DESTROY(hwnd, wParam, lParam, Enumres_OnDestroy);
break;
default:
return Listbox_WindowProc(hwnd, uMsg, wParam, lParam);
}
return 0;
}
BOOL InitInstance(int nCmdShow)
{
LCID dwCurrLocale = MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), SORT_DEFAULT);
if (SetThreadLocale(dwCurrLocale))
{
HMENU menu = LoadMenu(NULL, TEXT("GENERIC"));
if (menu)
{
HWND hwnd = CreateWindow(
TEXT("LISTBOX"), // name of window class
TEXT("Enumres"), // title-bar string
WS_OVERLAPPEDWINDOW, // top-level window
CW_USEDEFAULT, // default horizontal position
CW_USEDEFAULT, // default vertical position
CW_USEDEFAULT, // default width
CW_USEDEFAULT, // default height
NULL, // no owner window
menu, // required menu
NULL, // handle to application instance
(LPVOID) NULL); // no window-creation data
if (hwnd)
{
Listbox_WindowProc = (WNDPROC) SetWindowLong(hwnd, GWL_WNDPROC, (LONG) Enumres_WindowProc);
if (EnumResourceLanguages(NULL, RT_MENU, TEXT("GENERIC"), Enumres_EnumProc, (LPARAM) &hwnd))
{
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
return TRUE;
}
}
}
}
return FALSE;
}
int WINAPI _tWinMain(HINSTANCE hCurrInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, int nCmdShow)
{
if (InitInstance(nCmdShow))
{
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return ((int) msg.wParam);
}
return 0;
DBG_UNREFERENCED_PARAMETER(hPrevInst);
DBG_UNREFERENCED_PARAMETER(lpCmdLine);
}
EOF
cat > resource.h << EOF
#define ID_FILE_NEW 100
#define ID_FILE_OPEN 101
#define ID_FILE_SAVE 102
#define ID_FILE_SAVE_AS 103
#define ID_FILE_PRINT 104
#define ID_FILE_PRINT_SETUP 105
#define ID_FILE_EXIT 106
#define ID_EDIT_UNDO 200
#define ID_EDIT_CUT 201
#define ID_EDIT_COPY 202
#define ID_EDIT_PASTE 203
#define ID_EDIT_LINK 204
#define ID_HELP_CONTENTS 300
#define ID_HELP_SEARCH 301
#define ID_HELP_HELP 302
#define ID_HELP_ABOUT 303
#define ID_HELPTOPICS 304
EOF
cat > generic.rc << EOF
#include "windows.h"
#include "winver.h"
#include "resource.h"
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
GENERIC MENU
BEGIN
POPUP "&Файл"
BEGIN
MENUITEM "Созд&ать\tCtrl+N", ID_FILE_NEW, GRAYED
MENUITEM "&Открыть...\tCtrl+O", ID_FILE_OPEN, GRAYED
MENUITEM "&Сохранить\tCtrl+S", ID_FILE_SAVE, GRAYED
MENUITEM "Сохранить &как...", ID_FILE_SAVE_AS, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Печать...\tCtrl+P", ID_FILE_PRINT, GRAYED
MENUITEM "Пара&метры страницы...", ID_FILE_PRINT_SETUP, GRAYED
MENUITEM SEPARATOR
MENUITEM "В&ыход\tAlt+X", ID_FILE_EXIT
END
POPUP "&Правка"
BEGIN
MENUITEM "&Отменить\tCtrl+Z", ID_EDIT_UNDO, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Вырезать\tCtrl+X", ID_EDIT_CUT, GRAYED
MENUITEM "&Копировать\tCtrl+C", ID_EDIT_COPY, GRAYED
MENUITEM "&Вставить\tCtrl+V", ID_EDIT_PASTE, GRAYED
MENUITEM "Ссы&лка", ID_EDIT_LINK, GRAYED
END
POPUP "&Справка"
BEGIN
MENUITEM "&Содержание", ID_HELP_CONTENTS, HELP
MENUITEM "&Предметный указатель...", ID_HELP_SEARCH, HELP
MENUITEM "О сп&равочной системе", ID_HELP_HELP, HELP
MENUITEM SEPARATOR
MENUITEM "&О программе...", ID_HELP_ABOUT
END
END
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
GENERIC MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW, GRAYED
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN, GRAYED
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE, GRAYED
MENUITEM "Save &As...", ID_FILE_SAVE_AS, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT, GRAYED
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit\tAlt+X", ID_FILE_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO, GRAYED
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT, GRAYED
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY, GRAYED
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE, GRAYED
MENUITEM "Paste &Link", ID_EDIT_LINK, GRAYED
END
POPUP "&Help"
BEGIN
MENUITEM "&Contents", ID_HELP_CONTENTS, HELP
MENUITEM "&Search for Help On...", ID_HELP_SEARCH, HELP
MENUITEM "&How to Use Help", ID_HELP_HELP, HELP
MENUITEM SEPARATOR
MENUITEM "&About Generic...", ID_HELP_ABOUT
END
END
EOF
rc generic.rc
cl /nologo /MDd /Zi /D_UNICODE /DUNICODE generic.c generic.res user32.lib
|
|
|
|
|
I have been trying for about a week to install my Visual C++ application (via a deployment project in Visual Studio .Net)on a Laptop PC, but after many loops and changes the situation is that the application does not run (I think), the hour glass (mouse pointer) changes for about 1/2 sec when you double click on the program Icon.
ALso I did try and install Vcredist.exe which is a MS file to update any DLLs etc that a Visual Studio application may need on another PC without Visual Studio installed.
It does nothing!!??!! No error - nothing like an empty exe file
Are they some setting on this Laptop preventing new program files being changed/added to?
Its running Windows 2000 SP 5.
|
|
|
|
|
Hi, can anyone explain me about the unattendent install of windows 2000. I don't uderstand if we have 100 clients connect to the server with a blank hard disk (client). How could it run an installation from the server to the client if the client hard disk didn't format (may be they set the boot option...??? I'm not clear too) or without the command from an administrator (automate installation). I read the books and have a problem with that point. Just explain me in the frame of this process. Because I start don't understand from that point and could not complete the chapter.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Starting with the disclaimer of "I haven't done this, but..."
I just reviewed the discussion, albeit a brief one, in Windows 2000 Administrator's Black Book, 2ed, along with the Windows Help discussion of Remote Installation Service (RIS), and bits of the Resource Kit. While there are a few alternative methods available, the simplest seems to be:
Install Windows 2000 Pro on a new machine, along with any applications to be distributed. Share this on a network with a server running RIS. Run the Remote Installation Wizard (part of the Win2K Resource Kit) to create an image from the new installation and save the image in a RIS folder on the server. This strips from the image any machine-specific settings, including the SID and product ID. You then create an answer file to be used for the remote installations which provides answers to all the steps you'd normally respond to manually on each installation.
For each client you create a boot floppy that starts the machine in a network accessible state and run Winnt32 with command line options that direct it to use the network share containing the answer file and the image created for RIS. This will prepare the hard drive and download the image to each client, and the individual machines will be configured by Plug-and Play for minor hardware variations. There are methods to fully automate the process, by including the unique license keys for each machine on the floppies, but I didn't delve into it that deeply. This is a case when an investment in the Resource Kit is definitely justified, as this is where the most information, and the tools to automate the task are found.
Have fun!
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
If I have mutliple JREs installed on my machine, is there a way to have set it so that netscape 7 uses a particular one by default? Currently Netscape will use the most recently installed JRE, but is it possible to manually set it?
thanks
L
|
|
|
|
|
Is there a way of identifying which process has a lock on a resource? I have a strange problem where I am trying to build my C# application and it cannot build one of the DLL's because another application has a lock on it. But when I look all processes and threads have shut down.
I am at my wits end. My last hope is to work out which app has it locked - then work back from there.
Thanks in advance.
Bryon
|
|
|
|
|
Google for a nifty app called 'Whoslocking' - it's perfect for this sort of thing, and free.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Hi,
I am doing one application, which needs to connect to an unix machine and need to execute batch file. I tried to execute the rsh command from my windows xp machine. It's not running?? How can I do that??
What are the prerequisities for the XP machine to do this??
Regards,
Satya
|
|
|
|
|
Yesterday I thought it might be fun to set up my home network again. It's been idle for a few years, and I wanted to play with some configuration options before I attempt them at work. I tried for hours to make a Win2K machine connect to the server with no success. Everything set up correctly, but no connection. Using automatic addressing wasn't working - DHCP didn't seem to be responding. Static addressing allowed me to ping by address, but not to browse, and routing wasn't working at all (using NAT to share an Internet connection).
As a last resort I opened up Sygate Personal Pro to view the packets being exchanged on the network and discovered that everything from the client host was being blocked! Since the local interface was disabled when I installed it, I assumed that SPP only monitored the WAN interface. Wrong! It doesn't automatically discriminate between NICs; it blocks all packets regardless of source if a service is blocked. I had blocked DHCP, WINS, and DNS long ago when I found my machine serving the rest of my ISP's network, so now it was blocking my own internal network traffic.
Fortunately there is an Advanced settings tab that allows me to define which subnets and ports are allowed to access various services. Using that tool for each service running will be tedious, but it should allow me to block external traffic while permitting my own subnet to work smoothly.
Just a word to the wise if you find yourself tearing your hair out over a network that you know is set up correctly, yet refuses to connect. Check for a firewall running and disable it briefly before setting fire to the building!
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Yeah, I'm not a huge fan of sygate. It has some nice blocking options but often goes way beyond the realm of usefulness.
Matt Newman
All rise for the honorable Judge Stone Cold Steve Austin - From Dilbert Episode 30
|
|
|
|
|
I like Sygate far better than ZoneAlarm, in terms of functionality, but I miss ZAP's easy configuration. Sygate is more effective and less intrusive, but it is much harder to configure properly.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Roger Wright wrote:
I like Sygate far better than ZoneAlarm, in terms of functionality, but I miss ZAP's easy configuration. Sygate is more effective and less intrusive, but it is much harder to configure properly.
I totally agree with you there, another problem I had was high amounts of traffic would completely hose my system. even if the traffic was on a NIC that it wasn't supposed to be listening on.
Matt Newman
All rise for the honorable Judge Stone Cold Steve Austin - From Dilbert Episode 30
|
|
|
|
|
Got a call from a friend. His internet connection stopped working last night and he couldn't figure out why.
I went over this afternoon and had a look. His NIC and Switch both said he had a network connection though Windows didn't think so. It had everything set to an auto supplied IP Address. Funny thing was his wifes machine worked fine.
Trying ipconfig /renew resulted in the following message An error occurred while renewing interface local area connection: an operation was attempted on something that is not a socket..
I couldn't make any sense from this and headed off to try my luck with Google. I found a few sites mentioning that this is a side affect of removing certains pieces of spyware. One also pointed me to WinsockFix[^], it fixed the problem and internet connection is now up and working. Have a look and keep in your kit bag for when you need it.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So i had to leave the place as soon as possible."
- Mr.Prakash 24/04/2004
|
|
|
|
|
Handy tool, Michael! A number of viruses hijack the winsock dll, and deleting it will leave the machine without networking capability. If this is what the tool fixes, running SFC might do the same, detecting the lack of a critical file and replacing it. I checked this link, just in case, and it won't let me in. It's at the University of Virginia, and requires a user account.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
It fixes stuff in the registry that is screwed by the viruses/spyware, it doesn't replace the DLL if it's missing.
I lied about that link. I didn't remember to write down the error message or the website I found the fix on or anything. So I Googled from memory when I got home and found the error message correctly, then just posted a link to the first site that came up fron WinsockFix Homepage.
Google for Winsockfix.zip and you will get the utility.
<edit>Try this[^].<edit>
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So i had to leave the place as soon as possible."
- Mr.Prakash 24/04/2004
|
|
|
|
|
Got it...;)
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Does anyone know how to read and write to LIF formatted disks?
I can do it in Win 95 and in DOS using a program called LIFUTIL.EXE, but this program wont work under NT, 2000 or XP. Something to do with the way these OS's restrict access to BIOS and old DOS int's.
However I really need to be able to do this on win 2000. Some code ideas for C# would be great.
Either a way to use BIOS and old DOS int's under win 2000, or some idea's for doing the same thing with WIN API's would be good as well.
|
|
|
|
|
hi, i have a problem with my windows xp pro. i create 4 user account in my computer. but sometime when i turn on my computer, it display only 3 user accounts. does any one know the problem is?
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Windows Xp does have a way to hide a user account. Usually though, it is only the Administrator account that is hidden.
One way to see investigate this a little more, would be to start your computer in Safe Mode. It should show all user accounts.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
Hi, thank you very much for you idea. I know that the administrative account is hidden automatically when we change the log in screen to the “Welcome log in screen”. But the account that not show is the account that I have created for my family member. Of course all of the new account I permit as “Administrator”. For login to safe mode, I think it is difficult for us because we need to work and the graphic in safe mode is not easy to read as in normal mode. Do you any idea about that?
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I have a file that is created (0526000004.TMP) in one directory. The file is creating daily and has the format of today's date being in the name (ie. file above is the file for May 26, 2004).
I need to go to that directory and grab that file (based on today's date, but formatted like the filename is formatted "MMDDxxxxYY".TMP), copy or move that file to another directory called "Backup", then copy that file to another directory called "Renamed" and rename the file "Import.TMP". From the "Renamed" directory, I will be importing that file daily into an MS Access Db.
This will be a daily occurrence.
Im rough with DOS commands, so any help would be much appreciated!
Thanks
Cavall
"Nothing is at last sacred, but the integrity of your own mind."
"What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
|
|
|
|
|
The directory that the file is first created in. Is it the only file in the directory that has the file extension .TMP ? If so then it shouldn't be to hard. If not then it might be a challenge that requires something more than a simple bat file.
Cheers
uator
|
|
|
|
|
Currently it is one of many files b/c it is created daily.
Once the process is set in place, though, we would make it rename the file and move it and the original copy to another folder so that the active working directory would only have that one TMP file.
Got any ideas?
THanks
"Nothing is at last sacred, but the integrity of your own mind."
"What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
|
|
|
|
|
Is there a free or really cheap monitoring tool out there? The network at work runs a proprietary package for sales of motorcycles, boats, personal watercraft, and parts for all. It periodically reports an error, varying in details, but always indicating to me a connection problem, too many collisions or something. The cabling in the building is a really botched job, and I suspect that timeouts are occurring in database requests, since these errors nearly always happen when a user tries to update something. What I need is a simple tool to listen in on the network - client or server side - and report the number of collisions, bad packets, etc over a period of time. Ideally it would do so from the background, recording results to a log file.
If this was a Win2K system I'd use the performance counters that are built in, but it's built around a WinNT server and Win98 clients. WinNT is too hard to configure for this (and the server is too slow @ 500MHz), and Win98 lacks the facility at all. Any suggestions?
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
|