HDTenEightyP/NetNews huggingface dataset:
From: gbb@aii.com
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: How to get at PHYSICAL memory under WIN3.1 and BCC ?
Date: 27 Aug 92 17:32:07 GMT
Distribution: na
Organization: Automation Intelligence

I have a very-simple memory mapped input board that needs to be displayed
by a Windows application.

What's the simplest way to get at it ?	Not real-time , no-interrupts.

I can't just point at it, it's not there. I've tried to write a DOS TSR
that would pass me parts of the data via registers from a software 
interrupt, but I get a General Protection Fault. If I run a dos app
under WINDOWS IT WORKS ? The TSR was loaded via the WINSTART.BAT method.

I really think this is too simple to have to wade through the DDK manuals
(even tho I did a bit, with no obvious answer) and write a DEVICE DRIVER.

Why doesn't my Borland 3.0 manual have any references or examples of how
to do either of these things ?

I'm sure neophite Windows programmers ask this question all the time, but
I have not been able to find the FAQ on this topic.

Can someone please point me at some references or a simple piece of 
example source code or the FAQ location where this answer could be found.
Newsgroups: comp.os.ms-windows.programmer.misc
From: mccreary@sword.eng.hou.compaq.com (Ed McCreary)
Subject: Re: grumble, grumble, damn h
Organization: Compaq Computer Corp.
Date: Mon, 31 Aug 1992 21:39:34 GMT

In article <715053988.3@ttlg.ttlg.UUCP> Monroe.Thomas@ttlg.UUCP (Monroe Thomas) writes:
>EM>A curious problem with generating a help file.  I'm using Word 2.0 to
>  >create the RTF file and then HC 3.00a to compile it.
>
>EM>The problem is with inserting a bitmap into the file.  I use the
>  >command {bml printer.bmp} and then some text.  But, instead of a
>  >bitmap, I get the text {bml printer.bmp}.  Does this have to be
>  >typed in a particular font?  Is there a limitation as to what
>  >can precede or follow it?
>
>You *may* need to include a section in your help project file (.hpj) with
>the heading of [BITMAPS]. Ie:
>
>[BITMAPS]
>printer.bmp
>
>This *should* make things work!

Nope, tried that.  Someone told me that there is a new version of HC.EXE
out, I'm going to try that.

--
McCreary@sword.eng.hou.compaq.com     Computers are like Old Testament gods;
Me? Speak for Compaq?  Yeah, right.   lots of rules and no mercy.
"By this time my lungs were aching for air..."               Joseph Campbell
From: marwk@levels.unisa.edu.au
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: How to make double-clicks be responded to?
Date: 1 Sep 92 11:46:25 GMT
Organization: University of South Australia

With TC++ & OWL

How do you get a message response function to respond to WM_LBUTTONDBLCLK?

We have tried setting the windowclass.style = CS_DBLCLKS inside the
redefinition of GetWindowClass() member of function.

Only the single click message response member function is responded to.

How can we fix this please?

Thank you.

Raymond
Newsgroups: comp.os.ms-windows.programmer.misc
From: bmcphers@alias.com (Brent McPherson)
Subject: Re: Using extended character set in menus
Keywords: Windows 3.0
Organization: Alias Research Inc., Toronto ON Canada
Date: Wed, 26 Aug 1992 17:10:18 GMT

In article <55877@olivea.atc.olivetti.com> os2dev@flash.ATC.Olivetti.Com (Bruce Rienzo) writes:
>In article <kbbnz+=.whedon@netcom.com> whedon@netcom.com (Bill Whedon) writes:
>>>I would like to display arrow symbols next to a menu item to indicate 
>>>that the arrow key is the accelerator for this item.
>>>
>>>How do I do it?
>>See "Programming Windows" by Charles Petzold, Microsoft Press, 
>>ISBN 1-55615-264-7, the section titled "USING BITMAPS IN MENUS"
>>Cheers,
>>Bill Whedon
>
>Thanks for this Bill but I don't have quick access to this book. I have 
>looked at the section on using bitmaps in menus but  it seems to me 
>that the entire menu item that is changed
>with ModifyMebu has to be a bit map.
>

Yes, the entire item has to be a bitmap but it isn't that hard to do.
I wrote a similar function that took a bitmap and a string and
produced a bitmap menu item that had the bitmap prepended to the string.

You just create a bitmap big enough for the symbol bitmap and the string
(GetTextExtents) and draw the bitmap and the string (in the correct font).
The result is great and looks exactly like an ordinary menu item.
Also, the Petzold example is a great place to start and should give
you all the info you need to do this.

Warning: if you use a color bitmap for the image I found
that the selected menu item looked really ugly since the inversion did
not extend to the edges of the menus (at least it worked this way in
Windows 3.0). Therefore, stick to black and white bitmaps.

Hope this helps!
--
Brent McPherson        (bmcphers@alias.com)
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: OwnerDraw ListBoxes - Misc.
Date: 25 Aug 92 18:51:35 GMT
Organization: PE-Nelson

In article <1992Aug24.221410.10712@ods.com>, scott@ods.com (Scott Harper) writes:
|> I have some questions relating to OWNERDRAW list boxes.  I'm using
|> MSC 6.0 with SDK 3.1.  My list box is created (via CreateWindow) with 
|> the following style:
|> 
|>    WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL |
|>    LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | 
|>    LBS_WANTKEYBOARDINPUT | LBS_NOTIFY
|> 
|> 1. It appears that whenever I send a LB_ADDSTRING (or LB_INSERTSTRING)
|> the entire background of the list box is getting erased prior to
|> the WM_DRAWITEM for the new item.  The effect of this is that I actually
|> get (at least) one WM_DRAWITEM for each item in the list box, not just
|> the new one.  This results in a very noticeable flicker, especially as 
|> the list gets longer.  How can I prevent this?

Before adding all the items to your listbox send the following message:

   SendDlgItemMessage(hDlg, IDLIST, WM_SETREDRAW, 0, 0L);

This tells the control not to redraw itself, ever, when other messages
are received that would affect the display.  After you have added the
items you need to then do this:

   SendDlgItemMessage(hDlg, IDLIST, WM_SETREDRAW, 1, 0L);
   InvalidateRect(GetDlgItem(hDlg, IDLIST), NULL, TRUE);

This is pretty standard when filling a listbox in a loop.  If you still
get the flicker, try changing the last parameter to InvalidateRect to
FALSE (don't erase the background).  This may do unwanted things if your
routine to draw an item works in "transparent" mode.


|> 
|> 2. WM_VKEYTOITEM vs WM_CHARTOITEM question

Curious, I have a couple of listboxes where I do the same thing and everything
appears to function as described in the reference -- I use LBS_HASSTRINGS
because I want the VKEYTOITEM message.  If you're getting a message you can
use I'd say you're OK and there's probably no reason to worry.

|> 
|> 3. Can anyone give me a quick and sure way to force the list box to be
|> scrolled to the bottom?

See the LB_SETTOPINDEX message.



----------------------------------------------------------------------------
Tom Brown               |  "Strange women, lying in ponds, distributing
PE Nelson Systems       |   swords is no basis for a system of government."
twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
----------------------------------------------------------------------------
From: mccreary@sword.eng.hou.compaq.com (Ed McCreary)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Petzold Book and Substitutes
Date: 3 Sep 92 16:36:53 GMT
Article-I.D.: twisto.1992Sep3.163653.27202
Organization: Compaq Computer Corp.

In article <1992Sep2.201535.19713@PacBell.COM> jcwasik@srv.PacBell.COM (Joe Wasik) writes:
>
>Some users of the Petzold book have complained that the newest features,
>such as using palettes in the 3.0 book, were left out.  If they're right,
>perhaps we should be looking for a combination of books.
>

It's true.  He later went into detail regarding them in his Environments
column in PC Magazine.  He explained that the version of 3.0 he was using
to write his book was a beta copy and the logical palettes were not
yet finalized.

That series of articles is a good one to find if you want to know how
to use logical palettes.


--
McCreary@sword.eng.hou.compaq.com     Computers are like Old Testament gods;
Me? Speak for Compaq?  Yeah, right.   lots of rules and no mercy.
"By this time my lungs were aching for air..."               Joseph Campbell
Newsgroups: comp.os.ms-windows.programmer.misc
From: torstein@kjemi.unit.no (Torstein Hansen . Elektrokjemi)
Subject: Re: Mouse Grid Snapping
Organization: Lab. of Chem.Eng, Norwegian Inst. of Tech.
Date: Thu, 27 Aug 92 19:29:38 GMT

In article <1992Aug27.163123.8921@bcrka451.bnr.ca> carr@bnr.ca (John Carr) writes:
>
>
> Does anyone know how to implement mouse grid snapping in MS-WINDOWS
>using C or BorlandC++ ?

There is no functions in the Windows API to implement a grid snapping feature.
You may try to simulate one by:

  Declare a variable to hold the actual mouse position. (RealMousePos)
  Declare a variable to hold the "virtual" mouse position (VirtualMousePos)

  When your program receives a mouse message compare the mouse position in
    lParam with what you have stored in VirtualMousePos. Update RealMousePos
    accordingly. 
  If the change in RealMousePos suggests an updated VirtualMousePos
  then
    Set VirtualMousePos to nearest grid point of RealMousePos
    call SetCursorPos(VirtualMousePos.X,VirtualMousePos.Y)
  else
    call SetCursorPos(VirtualMousePos.X,VirtualMousePos.Y)
  
Be careful not to restrict mouse movement in other applications...

Last: You might consider restricting actions like line drawing etc. to grid
points, or use SetCursorPos only when a buttondown or buttonup message is 
received. By doing this the user will get a better "feeling" of what is going
on.

I hope this was of any help.

Regards...

Torstein Hansen
Newsgroups: comp.os.ms-windows.programmer.misc
From: plummer@hercules.cs.uregina.ca (Dave Plummer)
Subject: Re: invalid window
Reply-To: plummer@hercules.uregina.ca (Dave Plummer)
Organization: University of Regina, Regina, Saskatchewan
Date: Wed, 26 Aug 1992 14:12:16 GMT

How do I go about setting the maximum size to which my window can be resized?
Is there a setting or API call to do this, or can I just handle it in
WM_SIZE?

Thanks....


Newsgroups: comp.os.ms-windows.programmer.misc
From: tik@eceyv.ncsu.edu (Tsei Kuo)
Subject: BBS for Microsoft System Journal
Organization: North Carolina State University
Distribution: usa
Date: Tue, 1 Sep 1992 15:54:45 GMT

Help,
 
Can someone tell me how can I download some sample codes from
Microsoft System Journal's BBS.  I try several numbers on the 
MSJ but no luck. 

I don't have CompuServe, but I do have a 9600 modem and Internet
access.
 
Thanks a lot,

 
Tsei Kuo
From: carr@bnr.ca (John Carr)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Mouse Grid Snapping
Date: 27 Aug 92 16:31:23 GMT
Reply-To: carr@bnr.ca (John Carr)
Organization: Bell-Northern Research, Ltd
Originator: carr@bcrks49



 Does anyone know how to implement mouse grid snapping in MS-WINDOWS
using C or BorlandC++ ? Currently, as I move the mouse around, the
mouse cursor continuosly moves from pixel to pixel on the screen with
any pixel location being valid for the hot spot. Is there a way to
set the mouse up such that it only allows the mouse cursor to occupy
predetermined pixel locations (ex. every nth pixel in both the vertical
and horizontal locations)? 

 Any help with this would be greatly appreciated, thanks.

Regards...

John Carr
carr@bnr.ca
From: timmer@dutiag.tudelft.nl (I. Timmermans)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: ole
Summary: ole
Keywords: ole
Date: 28 Aug 92 10:43:44 GMT


Hello, 

I'm looking for information on programming OLE applications for
Windows. More specific; I'm looking for the source code of a
sample OLE client application which is a bit less complicated
than the CLIDEMO sample of the SDK. I would like to know what the 
minimum is one should do to support a bit of OLE.

FYI: I'm writing a file viewer which should be able to view 
objects through using an OLE server (e.g. view a bitmap bycreating a link with PaintBrush).

I'm also looking for a simple sample program which explains how I
should create a metafile and copy it to the clipboard. So far, my
implementations (based on the Petzold book) haven't led to much
good. (Clipboard Viewer can display them, but Write can't).

I hope you can help me,
Hans Timmermans
(timmer@dutiws.twi.tudelft.nl)
(compuserve 75730,1727 (will be from internet: 75730.1727@compuserve.com))



Newsgroups: comp.os.ms-windows.programmer.misc
From: sdj@franz.com (Steve D. Jacobson)
Subject: NotifyRegister() question
Organization: Franz Incorporated, Berkeley CA
Date: Thu, 27 Aug 1992 17:37:16 GMT

I would like to invoke WinExec() and then wait in a temporary GetMessage()/
DispatchMessage() loop until the application invoked by WinExec() terminates.

I am trying to use the toolhelp DLL NotifyRegister() function to do this.

By looking for a NFY_EXITTASK notification, I can tell that some application
has completed, but I can't tell that it's the one I'm interested in. The
other things I've tried, like looking to see if the NFY_DELMODULE handle
matches the return value I get from WinExec(), don't work.

Has anyone out there tried to do something like this and figured out what
notifications to look for?

Thanks,

Steve
Newsgroups: comp.os.ms-windows.programmer.misc
From: koivu@ocoee.cs.ucf.edu (Bruce Koivu)
Subject: Reading in PAN FIles--Upside down--Why? What purpose?
Summary: Would like a simple example
Keywords: DIB
Organization: University of Central Florida
Distribution: comp
Date: Sat, 29 Aug 1992 21:47:12 GMT

I have been trying to write a program that will read
and scroll a PAN file in under SetDIBits() and BitBlt()
and am having a rather rough time.  PAN files are simple
8-bit color images very similiar to the 8 bit DIB format.

I have been able to display the PAN files, but they
are upside down and backwards.  The documentation mentions
that the origin for a DIB is the bottom-left corner
of the DIB, yet this doesn't help very much.
Do I really have to read a PAN file into a globally
allocated DIB in backwards to Blit it right-side up?
Could some write a simple example for reading a
simple file into a bitmap right-side up.  Everything
that I have written to date displays all my pan
files upside down.  

This is my 2nd weeks of windows programming, there
are many "Application Error" and "System Error"
messages which are not referenced in the documentation,
where does one find info about these error messages.
Also, the CVW debugger seems to be a bit "buggy"
itself, What is the best way to learn how to
debug a Windows program? Any help would be appreciated.
Thanks in advance.
Bruce    koivu@eola.ucf.edu
From: JRBANGA@poppy.ucdavis.edu (JULIO RODRIGUEZ BANGA)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Using VB+Fortran
Date: 23 Aug 92 19:45:56 GMT
Organization: University of California, Davis
X-News-Reader: VMS NEWS 1.20


 Hi everybody.

 I'm trying to give a GUI to some scientific Fortran programs.
 I'm thinking of using MS Visual Basic in combination with MS Fortran.

 Has anyone gone through the same experience?
 Any advice/comments/references?
 Anything I should be aware of?
 
 Is there a better way to do this?

 Thanks in advance.


 Julio R. Banga
 University of California, Davis

Newsgroups: comp.os.ms-windows.programmer.misc
From: wwn8108@tamsun.tamu.edu (Weldon Nash)
Subject: Interrupt Servicing Within Windows 3.1 ????
Organization: Texas A&M University, College Station
Date: Fri, 4 Sep 1992 03:06:05 GMT

	I was wondering if anyone out could help me figure out how to process
interrupts in the Windows 3.1 OS.  I am used to just writing an interrupt
handler and providing the address of such to the interrupt vector table.
However, I would be willing to bet that it is just a slight tad :-) more
complicated in Windows.  I have Borland C++ 3.1 but cannot find anything
hardly worth understanding to help me out here.  It does mention a function
within the ToolHelp library (InterruptRegister) that defines a callback
function for all interrupts but I don't see how a task could determine which
interrupt has been issued.

	I need help on this.  Is it as simple as loading a piece of
non-moveable code and putting its address in the interrupt vector table
or not? Thanks..

	Please respond via e-mail.

					-Trey

wwn8108@tamsun.tamu.edu
Electrical Engineering Dept.
Texas A&M University
Newsgroups: comp.os.ms-windows.programmer.misc
From: bmcilroy@nyx.cs.du.edu (Bernie McIlroy)
Subject: Re: App./TSR needs to know that a DOS session has focus - How?
X-Disclaimer: Nyx is a public access Unix system run by the University
	of Denver for the Denver community.  The University has neither
	control over nor responsibility for the opinions of users.
Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
Date: Thu, 27 Aug 92 02:20:06 GMT

In article <1992Aug25.093642.8421@apricot.co.uk> marcusj@apricot.co.uk (M
rcus Jenkins) writes:
>I have an app./TSR/DLL (and VxD for Enhanced Mode) system supporting
>some special hardware.  I want (at least) one of these components
>to be notified or find out by polling (and the latter would have to
>be a re-entrant service since I would be polling off a harware IRQ)
>that a DOS session is becoming active/inactive or is active.  How?
>

There are three methods that come to mind:
  1) In your TSR, watch for the Windows INT 2Fh Startup broadcast.  When
     you see this, issues the INT 2Fh Get VM ID call.  At any given time,
     your TSR can call the Get VM ID and compare to the original value 
     which was the system VM ID.  (Sorry, I don't know the AX= numbers
     offhand...)

  2) Your VxD will receive a VMM_Set_Execution_Focus call when you switch 
     VMs.  Keep track of where you are. 

  3) At any time, your VxD can call Get_Cur_VM_Handle
     and Test_Sys_VM_Handle to see if the currently executing VM is
     a DOS box.
 
-------------------------------------------------------------------------
The above opinions are mine and you can't have them; so there.

Newsgroups: comp.os.ms-windows.programmer.misc
From: matts@microsoft.com (Matt Saettler)
Subject: Re: Weird problem with MMAPI and STRICT
Date: 27 Aug 92 23:05:24 GMT
Organization: Microsoft Corporation

In article <6447@kielouta.fi> jere@uta.fi (Jere K{pyaho) writes:
>Can anyone figure out what is happening here:
>
>This is Win3.1, Borland C++ 3.1. I have the following, very
>simple piece of code, written in straight C, which uses the
>Windows 3.1 Multimedia API:
>
>#include <windows.h>
>#include <mmsystem.h>
>...
>HMIDIOUT hMidiOut;	/* handle to MIDI output device */
>UINT uiMidiOut;		/* MIDI output device ID */
>int iReturn;		/* call return value */
>
>iReturn = midiOutOpen( (LPHMIDIOUT) &hMidiOut, uiMidiOut,
>			(DWORD) hwnd, 0L, CALLBACK_WINDOW );
>
>Here, uiMidiOut has been initialized to a valid MIDI device ID -
>this I checked. The hwnd is just a window handle -- I don't
>think it makes any difference even if it is actually a dialog:
>a window is a window, right? So I could direct the MIDI messages
>to a scrollbar if I felt like it. ;-)
>
>Anyway, what happens is that when I compile this stuff with
>WIN31 and STRICT, the midiOutOpen() call bombs, giving me
>an Error 11: Invalid parameter passed to a system function.
>The funny thing is that when I compile it _without_ STRICT,
>the call works OK.
>
>So what's the invalid parameter? The obvious workaround is
>to compile without STRICT, but then you lose many other
>nice checks for stupid errors.
>
If you compile with MSC 7.00 with warnings on, you will get a warning:
"converting near pointer to long integer".  Looks like the Borland
compiler does not give similar warnings.

The near pointer is the hwnd.  To allow type checking, STRICT defines
the types as pointers so that the C compiler can do parameter and other
type checking.  When you cast the near pointer to a DWORD, the compiler
(correctly) first casts it to a far pointer.  This results in the hiword
containing DS instead of NULL, as you intended.  The solution is to
cast the hwnd first to a UINT (to be portable to 32-bit windows) and
then to the DWORD like this:

iReturn = midiOutOpen( (LPHMIDIOUT) &hMidiOut, uiMidiOut,
			(DWORD) (UINT) hwnd, 0L, CALLBACK_WINDOW );


Matt Saettler/Microsoft Multimedia
----------------
I speak only for myself....
Newsgroups: comp.os.ms-windows.programmer.misc,comp.windows.ms.programmer
From: bonneau@hyper.hyper.com (Paul Bonneau)
Subject: Re: Wierd string/memory problem
Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,)
Organization: HyperCube Inc.
Date: Wed, 26 Aug 1992 13:53:27 GMT

In article <1992Aug25.000954.28499@u.washington.edu> goble@hardy.u.washington.edu (Brian Goble) writes:
>I am experiencing a strange problem in my win 3.x app that appears
>to be (maybe) a stack or heap problem (?)
>
>The following two calls to a child window are showing the problem:
>
>
>  1)	SetWindowText(hChildWnd, (LPSTR)"SPEEDS - in MPH");
>
>	This call produces a window caption of: SPEED - in MPH|%losed
>	(where the character '|' is a solid bar)
>
> ------------
>
>  2)	DrawText(hDC, (LPSTR)"Closed", 6, (LPRECT)&Rect, DT_LEFT);
>
>	This call draws the text: %losed
>
[symptom descriptions deleted]

Your problem sounds like plain old memory trashing.  The
string is in your data segment.  I would use the debugger and
set a hardware watchpoint on the address of the character
being trashed.

cheers - Paul.
From: nadkarni@ashok.lkg.dec.com (ashok p. nadkarni)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Calling Novell from WIndows
Date: 28 Aug 92 13:11:39 GMT
Reply-To: nadkarni@ashok.lkg.dec.com (ashok p. nadkarni)
Organization: Digital Equipment Corporation


   
    How does one call Novell's Int 21H based services from Windows ? Does 
    Windows translate the corresponding INT calls (as for documented
    DOS Int 21) or does one have to use the DPMI interface to emulate real mode
    calls ?

    Also, can someone provide a reference that describes exactly which
    INT/FUNCTION pairs are supported directly by Windows ?

    Thanks
	

	/Ashok
Newsgroups: comp.os.ms-windows.programmer.misc
From: whedon@netcom.com (Bill Whedon)
Subject: Re: SetViewportExt and Screen Mapping
Date: Sun, 30 Aug 92 23:41:03 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 

In article <92242.153745IO70935@MAINE.MAINE.EDU> IO70935@MAINE.MAINE.EDU writes:
>I working on an application that requires a real time display for a data acqusi
>stion program and I need to remap the window. I would like to map the window in
> a user coordinate system such that one corner is x1,y1 and the other x2,y2. I
>am looking for any information or examples of how to do this my BC 3.0 Manuals
>are no help and Microsofts Reference Book little better. Thanks in advance.

In the normal coordinate system in Windows (where you have not specified any
mapping mode), the upper left corner of your screen is x1 = 0, y1 = 0, and
the lower right corner depends upon the actual size of the window rectangle.

You can use SetMapMode to move the coordinate system around, and to adjust
the coordinate system.  You use it along with SetWindowExt, SetWindowOrg,
SetViewportExt, and SetViewportOrg.  

Petzold has examples of several ways to set up your window mapping.
"Programming Windows" by Charles Petzold, Microsoft Press, ISBN 1-55615-264-7

Look up the commands I told you about in the index of this book.
Good luck,
Bill Whedon
From: s913578@yallara.cs.rmit.OZ.AU (Fantom)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Colours on buttons
Date: 4 Sep 92 02:03:38 GMT

I've been trying to set the colour of text on a standard (not owner-draw)
button and so far have had no success

Is it not possible, should I just use an owner-draw (where i assume it is possible)

thanks all

Fantom (s913578@yallara.cs.rmit.oz.au)

P.s. mailed replies would be prefered as i don't often get a chance to read this group
Newsgroups: comp.os.ms-windows.programmer.misc