HDTenEightyP/NetNews huggingface dataset:
From: jenk@microsoft.com (Jen Kilmer)
Subject: Re: windir environment variable is a constant!
Date: 11 Oct 92 23:43:53 GMT
Organization: Microsoft Corporation

In article <1992Sep30.153537.49725@ccvax.ucd.ie> ctwomey@ccvax.ucd.ie writes:
>
>When you open a DOS window and enter 'SET', one of the environment
>variables listed is as follows:
>	windir=C:\WINDOWS

Yep, it is, isn't it?

>(or equivalent).  This is the only env. variable whose name is in lowercase.
>I cannot change its value - if you try to
>Is this a bug in windows or was it intensional?  How do I alter or delete
>the windir variable? - or should I say the windir environment CONSTANT?

When you're at the "ms-dos prompt", you're in an ms-dos program
called command.com (or a replacement for it, such as 4dos or norton's
licensed version of 4dos which they call ndos). Command.com processes
some commands - like SET and COPY - and also runs programs, like
wp.exe (wordperfect) or win.com (windows).

Command.com always creates uppercase environment variables (when using
SET, PATH or PROMPT). Command.com also processes batch files & allows
using environment variables from within them - again, as uppercase
characters.  Whenever command starts another program, it hands off
a copy of the environment variables. When Windows starts a copy of
command (so's you can get to ze prompt) it hands off the variables too,
including windir.

So, "windir" is set by Windows. I've heard that it was supposed to be
usable in batch files or from the command line, but that the  
person who set it "messed up" by making it lowercase. THIS IS RUMOR.
I also know that the simple fact that windir can't be changed by SET
makes it more valuable to some programmers...so it could be that it
was made lowercase on purpose.  Note that 3.0 first had this (I think)
and 3.1 still has it...lowercase.

-jen
Newsgroups: comp.os.ms-windows.programmer.misc
From: dj@ekcolor.ssd.kodak.com (Dave Jones)
Subject: Re: msc++ mfc problem?
Organization: :noitazinagrO
X-Newsreader: TIN [version 1.1 PL6]
Distribution: comp
Date: Wed, 7 Oct 92 19:58:33 GMT

"richard fecteau" (richard.fecteau@channel1.com) wrote:
: I'm writing what I thought would be a simple trashcan program for 
: windows. My main window is derived from the CFrameWnd class with the 
: window style being WS_OVERLAPPED+WS_ICONIC+WS_SYSMENU. I've overridden the
: OnQueryOpen function with a RETURN FALSE statement so the window will stay
: iconized. The resultant program works fine if I run it from PWB. The 
: program does NOT work if I run it from File Manager or in CVW. Heapwalker 
: tells me that the program loads into memory but no icon gets displayed!? 
: If I remove the WS_ICONIC style then the program runs fine from File 
: Manager or CVW, but not as an icon. Am I doing something wrong or does MFC 
: have a bug?
: 
They don't call it Oop for nothing....seriously when I wrote my own
trashcan in good ol' C (O'Trash, top o'the mornin' to yer sor!) I set
up the window without a default icon.   This has the effect of causing
all repaint messages to be WM_PAINT, which allows you to decide how to
proceed using IsIconic().  Since the regular window was entirely taken
up by a listbox control, I did nothing unless the window was iconized,
in which case I just had to decide whether to paint the regular trashcan
(via LoadIcon/DrawIcon) or the fat trashcan.

Window style was nothing special (CS_HREDRAW | CS_VREDRAW |
CS_BYTEALIGNWINDOW) but wndclass.hIcon has to be NULL.

As you can probably tell I'm not into MFC yet, but it looks to me that
if you set up the window as I've outlined and write the Paint method
accordingly you should have no trouble.  I don't know what your regular
window is like - if you have one: mine is there to allow people to
untrash files by double-clicking on their names in a listbox.

Cheers.

Dave J.

Newsgroups: comp.os.ms-windows.programmer.misc
From: jim@edscom.demon.co.uk (Jim Thomas)
Subject: Re: Authoring Help Files
X-Disclaimer: #include <std/witty/disclaimer.h>
Reply-To: Jim Thomas <jthomas@edscom.demon.co.uk>
Organization: EDS-Scicon, Milton Keynes, UK
Date: Wed, 7 Oct 1992 12:20:36 GMT

>>>>> In article <1992Oct5.170817.2247@medtron.medtronic.com>, "Scott"
>>>>> == sh0001@israel (Scott Hansohn) writes:

Scott> What's the preferred (easiest) method for writing/maintaining
Scott> Windows help files?

Scott> The manuals talk about how you can use any RTF-capable word
Scott> processor, but then it launches into a discussion of the
Scott> nitty-gritty's of the RTF file format and the hypertext
Scott> extensions used by the help compiler.

Scott> Are there any word processors that support these extensions?  If
Scott> I take an RTF file for one of the help examples, and read it into
Scott> MicroSoft Word, it doesn't look particularly pretty, although I
Scott> can reexport it into RTF format, compile it, and come up with all
Scott> of the help links still active.

Scott> I'd like to believe that there's a better way than:

Scott>     1.  Write the basic text using your word processor, exporting
Scott> to a .rtf file.

Scott>     2.  Use an ASCII editor to hack in all of the hypertext
Scott> links.

Scott>     3.  Run the hacked file through the help compiler.

Scott> I think I'm missing something here.

I at first tried to use Word for Windows to prepare help files and it was
hard going. Then for a project I had to produce a context sensitive
help file with a single topice for each of over 100 event reports so I
needed a better way. As the event report details were held in a database
I wrote a small C program to read the data and massage it into an RTF file
format suitable for direct input into the help compiled. This worked very
well so I added and automatic glossary option that provided hot links
for words in the text that appeared in a specified list.

Since this I have modified the program to make it more general so that
I can easily produce RTF file for the help compiler from a few simple
text files. I'm sure that there must be products that do this sort of
thing for you as it is the obvious way to go. I would not like to have
to support a large projects help file in native RTF.

Jim Thomas
From: mdewinter@vms.eurokom.ie
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: program protection against illegal copy
Date: 12 Oct 92 16:16:28 CET
Organization: EuroKom Conferencing Service

Hi,
Does anyone know how to get
- the serial number of the windows version
  (not the winver stuff)
- the number of the bios or processor or any other hardware component???
Reason: make sure that a certain program is run only on a certain machine,
and that if someone - without the roiginal disks - takes the program
- steals the program - and tryes to run it on another computer,
the program doesn't run.
Please reply to this forum
or by E-mail: fhcaa79@cc1.kuleuven.ac.be
or to euriokom, my adres is at the top of this file
Bye,
/Guy.
Newsgroups: comp.os.ms-windows.programmer.misc
From: dce@smsc.sony.com (David Elliott)
Subject: Re: Authoring Help Files
Organization: Sony Microsystems, San Jose, CA
Date: Sun, 11 Oct 92 03:23:40 GMT


Not to be overly critical of you folks, but, in most cases, it really
isn't that hard to write help files using Word.  I'm very impressed
with the way Microsoft adapted RTF to do this.  I'm not so impressed
with the documentation in the SDK "Programming Tools" manual.  Luckily,
I started with an older book that explained all this in terms of
fonts and footnotes instead of RTF commands.

Unless you really have a lot of topics like Jim Thomas or have to do a
lot of edits, a good word processor works just fine.

Has someone out there put together a reference document (and maybe
even a template) for writing help files using Word?  If not, I'd
be interested in working with a few people to put such a thing
together.

--
...David Elliott
...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
...(408)944-4073
..."I take my arms and I wrap them around my art." - F
From: pam@vandi.ars.cl (Pablo Ahumada M.)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Problem with DialogBox & DestroyWindow. 
Distribution: world
Organization: Ars Innovandi (El arte de innovar)
Date: Thu, 08 Oct 1992 08:29:46 CST

In article <1992Oct1.194039.19009@netcom.com> hill@netcom.com writes:
>
> In article <1aaeeaINNoim@cs.tut.fi> pk64380@cs.tut.fi (pazi) writes:
> >
> >  Topic: Dialogbox() & DestroyWindow()
> >
> >  The application I'm working on has a modal child window, say the
> >"Read Window" created with DialogBox().
> >  This child in turn may have several (one at a time, though) modal child
> >windows, which in turn may have childs, etc, etc, all created with
> >DialogBox().
> >  The application also has a modeless window, the parent of which is the
> >main window. When certain events occur in this modeless window it may become
> >essential to close the "Read Window" along with any childs it may have.
> >I tried to do this simply by sending a message to the "Read Window", forcing
> >an EndDialog() call. This closed the Read Window allright, but not its childs.>
> >
> >  Now, I know windows created with DialogBox() are supposed to be ended with
> >EndDialog(), but I tried DestroyWindow() on the Read Window and it worked
> >almost perfectly.
> >  It did kill all the child windows as well as the Read Window itself, the
> >only problem being that the Main Window got disabled. It still accepts
> >messages, but no input.
>
> A modal dialog box disables its parent window (p 192, Guide to programming)
> which prevents the parent from getting any input. I would guess that destroying> the child does not re-enable the parent. Try sending a WM_ENABLE message to
> the parent before or immediately after destroying the child window.
>
> Tom Hill
>

I think the problem is where you are calling the EndDialog(), this
function must be called from the dialog box procedure. Try adding
a case WM_CLOSE in your Read Window dialog procedure
      case WM_CLOSE:
	 EndDialog( hDlg, IDOK );
	 break;

and to send a WM_CLOSE message from modaless dialog to Read Window dialog.

Hope this helps.

--
_______________________________________________________________

     ,''''',   ,''',,  ',''',''',,     Pablo Ahumada Mardones
    ,,	  ,,   ...,,   ,,  ,,  ,,      uucp: pam@vandi.ars.cl
   ,,	 ,,  ,'  ,,   ,,  ,,  ,,       fax: (56-2) 274-9737
  ,, '''''   ''''''' ''  ''  ''''      Santiago, Chile
 ,,

Newsgroups: comp.os.ms-windows.programmer.misc
From: rkl@cbnewsh.cb.att.com (kevin.laux)
Subject: Re: How do I set on Caps Lock?
Organization: AT&T
Distribution: na
Date: Tue, 13 Oct 1992 13:02:00 GMT
Keywords: caps lock

In article <1992Oct13.065101.29997@netcom.com>, whedon@netcom.com (Bill Whedon) writes:
> Well, I asked this on comp.os.msdos.programmer and got no answer.  Let's see
> if anyone _here_ can help...
> 
> I need to set on Caps Lock from inside my program.  I remember that it can be
> done, but don't recall how, or where to find the info.  I know that the
> states can be found at 0000:0417 hex, and Interrupt 16 Function 2 gets 'em,
> so I don't need _that_... just, how the heck do I set Caps Lock??

	Set bit 6 to a 1.  Yup, it's that easy.

-- 
________________________________________________________________________________
	R. Kevin Laux				Email: rkl1@hound.att.com
	AT&T Bell Labs				Voice: (908) 949-1160
	Holmdel, NJ 07733			Fax:   (908) 949-0959
Newsgroups: comp.os.ms-windows.programmer.misc
From: eduard@htsa.aha.nl (Eduard Beijnes)
Subject: replay serialnr harddisk
Organization: Algemene Hogeschool Amsterdam, The Netherlands
Date: Fri, 9 Oct 1992 13:25:51 GMT

The following programs writes 2911.1971 as a serialnumber on the 
default drive (29 nov 1971) 

----- uuencoded program / cut here -----
begin 600 serial.com
4N %ILP"Z#@'-(;1,S2$  '$9$2D 
 
end
----- end of uuencoded program /cut here -----

dump van debug.com:

2F73:0100 B80169        MOV	AX,6901                            
2F73:0103 B300          MOV	BL,00                              
2F73:0105 BA0E01        MOV	DX,010E                            
2F73:0108 CD21          INT	21                                 
2F73:010A B44C          MOV	AH,4C                              
2F73:010C CD21          INT	21                                 
2F73:010E 0000          ADD	[BX+SI],AL                         
2F73:0110 7119          JNO	q012B                               
2F73:0112 1129          ADC	[BX+DI],BP          

I don't have the documentation with me because I am on school while
I am writing this.

I am not sure but if you change MOV AX,6901 in MOV AX,6900 it reads the
serialnumber.

If this doesn't work email me (eduard@solist.htsa.aha.nl) and I will
look it up
Date: Sun, 11 Oct 92 13:40:36 +0100
From: Norbert_Unterberg@softstream.fido.de (Norbert Unterberg)
Subject: Re: Debugging Dll's
Newsgroups: comp.os.ms-windows.programmer.misc
X-Comment-To: kevr@is.morgan.com (Kevin Reilly)
Organization: Norbert_Unterberg@softstream.fido.de 


KR> I have written a number of dll's that are add-ins to Excel and Wingz.
KR> Can anyone suggest how I might debug these dll's in these particular
KR> environments? I have MultiScope and the Borland Debugger. Can I
KR> attach myself to these debuggers after the dll has been loaded by
KR> another app but not yet called?

I had a similar problem with a dll written for visual basic. Yes, there is a 
way to debug the dll (I assume its name is DebugMe.DLL):

1. Write a small but complete windows application that does nothing (i.e. use 
one of the many "hello world" windows apps around), and do a hLib = 
LoadLibrary("DebugMe.DLL") before entering the message loop, and a 
FreeLibrary(hLib) after the loop. Lets assume this dummy application is called 
"LoadDLL".

2. Compile LoadDll and DebugMe.DLL with debug options on.

3. Run the debugger (TDW) on LoadDLL.

4. Step through the code until you reach the LoadLibrary call and step over the 
call.

5. Now DebugMe.DLL is loaded, and you can do a "Load Module" (F3 in TDW) and 
load the symbols of the library (debugme.dll should be in the list now). You 
can scroll through the source and set breakpoints on the functions you want to 
debug.

6. Now press RUN (F9). You can now start Excel or Wings, as if the debugger was 
not loaded, and do any task you want. But if you let Excel call your DLL, the 
debugger will break on the breakpoints you set, and you can trace through the 
code.

Hope this helps!

Norbert
---
Norbert Unterberg        Phone:      ++49-2335-61786
Koehlerstr. 12c          CompuServe: 100112,2740
5802 Wetter 2            Internet:   Norbert_Unterberg@softstream.fido.de
Germany                  Fidonet:    Norbert Unterberg at 2:245/36.4
From: "richard fecteau" <richard.fecteau@channel1.com>
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: msc++ mfc problem?
Date: 7 Oct 92 01:28:12 EST
Reply-To: "richard fecteau" <richard.fecteau@channel1.com>
Distribution: comp
Organization: Channel 1 Communications

I'm writing what I thought would be a simple trashcan program for 
windows. My main window is derived from the CFrameWnd class with the 
window style being WS_OVERLAPPED+WS_ICONIC+WS_SYSMENU. I've overridden the
OnQueryOpen function with a RETURN FALSE statement so the window will stay
iconized. The resultant program works fine if I run it from PWB. The 
program does NOT work if I run it from File Manager or in CVW. Heapwalker 
tells me that the program loads into memory but no icon gets displayed!? 
If I remove the WS_ICONIC style then the program runs fine from File 
Manager or CVW, but not as an icon. Am I doing something wrong or does MFC 
have a bug?

Rich
richard.fecteau@channel1.com

---
  WinQwk 2.0 a#219  I'm on the lamb, but I ain't no sheep.
--
Channel 1 (R)   Cambridge, MA

Newsgroups: comp.os.ms-windows.programmer.misc
From: jgeniec@banana.cis.ohio-state.edu (Joseph Geniec)
Subject: Re: Which C Compiler
Organization: The Ohio State University Dept. of Computer and Info. Science
Date: Fri, 9 Oct 1992 17:48:44 GMT



	You might want to consider Borland C++ with Object Windows. Object 
Windows is a framework that is built upon the Windows API functions; it
takes most of the hassle out of windows programming. However, I found
that Borland defeats its own purpose by giving you extremely crappy
and cryptic manuals for a beginning windows programmer (like me!). The
framework is great, but you should also buy a book that will teach you
how to start using the Object Windows library without talking down to
you. (I used Turbo C++ for Windows, Inside & Out by Herb Schildt) Make
sure the Borland package you buy has OW, because I don't think all of
their windows compilers are sold with the framework. (I could be wrong
here) If you are poor like me, you might even consider buying 
Borland Turbo C++ for windows, which is the same but with a less-fancy
compiler, and OW is included.

						Joe Geniec
						jgeniec@cis.ohio-state.edu


Newsgroups: comp.os.ms-windows.programmer.misc
From: marshall@tfh.enet.dec.com (Hunting the Snark)
Subject: Re: Clock applet
Organization: Digital Equipment Corporation
Date: Fri, 16 Oct 1992 02:55:36 GMT


In article <1992Oct15.175501.22407@microsoft.com>, mattsq@microsoft.com (Matthew Squires) writes...
|>In article <1992Oct15.053454.8491@engage.pko.dec.com> marshall@tfh.enet.dec.com (Hunting the Snark) writes:
|>>I would like to imitate an interesting property of the Clock applet in Windows
|>>3.1 (I don't remember now if the one in 3.0 did this). When you select the "No
|>>Title" setting, holding the left mouse button down in the clock window puts it
|>>into the move mode the same as in the caption of of a normal window. How does 
|>>it do that? Is there an easy way (some undocumented windows fuction) or do they
|>>do it "the hard way" (LbuttonDown, SetCapture, GetDC, MouseMove, etc.) Is it 
|>>significant that it only does this when there is no title bar?
|> 
|>Yes, it's true!  There is another undocumented windows function called
|>"ImplementCoolClockBehaviorOnlyForMSApplications" that only we know
|>about.

Well to answer my own question: one of my collegues here did find an
undocumented method to do this. Since I've been using TPW/OWL; here is the 
method in that language that implements it:

 procedure MyProgram.wmLbuttondown(var msg:Tmessage);
 begin
    {hold down left mouse button to move window}
    SendMessage(msg.receiver,WM_SYSCOMMAND,SC_MOVE+2,0);
 end;{          ~~~~~~~~~~~~               ~~~~~~~~~this is not documented}


Works like a charm and seems alot easier than the method described below:

|>Seriously, look up the WM_NCHITTEST message.  If the user is clicking on
|>your client area (found by calling DefWindowProc and noting its return
|>value) then you would want to return HTCAPTION - i.e. windows should treat
|>this click as if it happened on the title bar.
|> 
|>There are other issues like handling double-clicks and you probably
|>don't want to let the user move your window if it is maximized, but

good point, hadn't thought of that, but this particular app under development 
can't be maximized anyway.

|>this should be enough to get you started.
|> 
|>Matt "not a spokesbeing for microsoft" Squires
|>mattsq@microsoft.com

Thanks Matt.


Steve
Newsgroups: comp.os.ms-windows.programmer.misc
From: jgeniec@murex.cis.ohio-state.edu (Joseph Geniec)
Subject: C++ question
Organization: The Ohio State University Dept. of Computer and Info. Science
Date: Thu, 8 Oct 1992 19:37:26 GMT


	Okay, I've got a simple question and darn it-- I want a simple answer.
What in the hell does the following do in a C++ program?

1) FAR
2) PASCAL
3) NEAR

And why can't I find a book, *one* book, that says what these are for?

								J.G.



Newsgroups: comp.os.ms-windows.programmer.misc
From: jagrant@emr1.emr.ca (John Grant)
Subject: object-oriented drawing program in windows
Organization: Dept. of Energy, Mines, and Resources, Ottawa
Date: Fri, 16 Oct 1992 06:13:14 GMT

I'm so used to thinking of creating child, popup, overlapped windows, dialog
boxes etc, that I just realized I have no idea of how to create other objects
that can be picked, moved resized etc.  For example, suppose I have a drawing
program where I can pick a tool and draw a circle, ellipse, rectangle etc.
Or perhaps a graphics object is created by reading and plotting a data file
or a metafile of GDI primitives.

Later how do I 'pick' that object so that I can move it, resize it or whatever.
Do I just create an invisible window and draw in its invisible client area?
Obviously the easiest way to 'pick' an item is to draw each object in its
own window, so hit-testing is not required.

In the GKS world, each graphical item is a segment and you can pick a segment
with the cursor (internally I think it just checks the (x,y) point with the
(x,y) of all of the items in the display list for each object.  I sure wouldn't
want to do that in Windows.

So: 1. how do I draw an object?  In it's own window?  What kind?
    2. how do I pick one of these objects?

Life is not just limited to moving and sizing rectangles around the screen.
Newsgroups: comp.os.ms-windows.programmer.misc
From: jagrant@emr1.emr.ca (John Grant)
Subject: Re: Windows Programming
Organization: Energy, Mines, and Resources, Ottawa
Date: Thu, 8 Oct 1992 02:38:24 GMT

In article <1992Oct3.024202.23266@vu-vlsi.vill.edu> devanath@tiger.vill.edu (Kiran devanath) writes:
>
...
>	1. How do I convert this into a string, I tried using 
>	   wsprintf and all combinations it seems to separate 
>	   me from the answer by a couple/lot of zeros.

I don't know anything about DLLs (yet), but I do recall hearing on CI$ that
'wsprintf' is *not* a replacement for 'sprintf' because strangely enough it
does *not* support float (i.e. %g, %f).  In fact, I just checked it in the
SDK prog ref vol 2: functions and it only lists c,d,i,ld,li,u,lu,lx,lX & s
formatting codes.  I guess they are serious when they say those are the
only formatting codes allowed.  MS should have made it perfectly clear that
it *didn't* support the other codes.
Newsgroups: comp.os.ms-windows.programmer.misc
From: hugh@mks.com (Hugh Brown)
Subject: VB and DLLs
Keywords: VB DLL
Organization: Mortice Kern Systems Inc., Waterloo, Ontario, CANADA
Date: Wed, 7 Oct 1992 22:51:31 GMT

I can get Visual Basic to make successful calls to 
USER, GDI, and Krnl386, but I cannot get it to work
on the simplest sort of DLL function that I write in C.

This will not work:
	int FAR PASCAL _export
	foo (void)
	{
		return 1;
	}
When I link this with a LibMain and a WEP using BC++ 3.1
and call it from VB, I get error messages about being unable
to open the DLL ("Error in loading DLL").  I have used a GENERIC.EXE
to call foo() before it processes each message and this does not
get any such message.  I have declared the function in GLOBAL.BAS as:
	Declare Function foo Lib "foo.dll" () As Integer
I can't see what I am doing wrong.  Oh, I have also tried altering
the .DEF file to use every conceivable variation of settings for DLLs,
starting with Petzold's DLL settings in chapter 19.

Has anyone else had this problem? It seems so simple that if it
were a problem for everyone, then the problem would be discovered
quickly and fixed.  This observation makes me think I am doing something 
wrong.

I will e-mail source to anyone interested.

Regards,
Hugh

All opinions are mine.
Newsgroups: comp.os.ms-windows.programmer.misc
From: mem@world.std.com (Jeff Lesser)
Subject: Edit Fields in Dialog Boxes
Keywords: dialogs fonts edit fields
Organization: The World Public Access UNIX, Brookline, MA
Date: Fri, 9 Oct 1992 15:25:44 GMT

We have a set of Windows 2.11 applications that we've 98% ported to
Windows 3.1.  We've cleaned up the ugliness in most of our 150 dialog
boxes, but have just discovered that many edit fields were set to fixed
widths in order to restrict the number of input characters.  Now, with the
proportional font, the user can in some cases (lower case) enter a lot
more characters than we can handle, and in other cases (upper case), fewer
characters than the real limit.

Is there a simple way, WITHOUT recoding all 150 dialog boxes, of having
Windows use a fixed-pitch font in edit fields, or in some other way
reinstate the character limits we had under Windows 2.11?

Thanks very much for any responses!