Message to Badara

Message to Badara

Postby Gilbert » Wed Nov 15, 2006 2:35 am

Hi Badara,

I started doing some testing with your Printer functions. It works fine execpt for WinDefPrn(). Works well with 98, 98SE and ME but not for 2000.
Did`nt check XP yet...

When I looked at Windows 2000 register HKEY_CURRENT_CONFIG,
System\CurrentControlSet\Control\Print\Printers has no value in `Default`
So it`s returning nothing. Thus not detecting the default printer.

I will check for XP tonight to see if there is any differences.

I also have another question. Is it possible, from the Windows register, to somehow detect what type of printer it correspond to.
ex.: Laser, InkJet, Dot Matrix or Thermal.

I closely examined the register and could not figure out if this information was present. But I tought it was hidden somewhere esle.

Regards,

Gilbert
Gilbert Vaillancourt
turbolog@videotron.ca
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Re: Message to Badara

Postby Badara Thiam » Wed Nov 15, 2006 6:24 pm

Hi Gilbert,

Gilbert wrote:
I started doing some testing with your Printer functions.


Thank you. You are the first returning a problem with.
This greatly interest me.

It works fine except for WinDefPrn(). Works well with 98, 98SE and ME but not for 2000. Did`nt check XP yet...


I don't remember if i have tested Default printer under XP,
because i don't use never this information.


When I looked at Windows 2000 register HKEY_CURRENT_CONFIG,
System\CurrentControlSet\Control\Print\Printers has no value in `Default`
So it`s returning nothing. Thus not detecting the default printer.

I will check for XP tonight to see if there is any differences.

I closely examined the register and could not figure out if this information was present. But I tought it was hidden somewhere esle.



To see if there is anywhere this information in the Windows 2000 registry,
please look and note all keys where the printer "My printer" is repertoried,
and look again after set it the default printer under Windows.
You will find something different, after. If yes, change again the default
printer to another, and verify if the new default printer is in the same path
in the Windows 2000 registry.

EveryBody who have another OS can greatly help us to definitely solve
printers problems in very little time. Thanks by advance.


I also have another question. Is it possible, from the Windows register, to somehow detect what type of printer it correspond to.
ex.: Laser, InkJet, Dot Matrix or Thermal.



I will see soon

Regards,
Badara
[/quote]
Badara Thiam
http://www.icim.fr
User avatar
Badara Thiam
 
Posts: 160
Joined: Tue Oct 18, 2005 10:21 am
Location: France

Postby Gilbert » Fri Nov 17, 2006 5:24 am

Hi Badara,

Searching for My Printer did not give any result but...
I did some exhaustive testing using the default printer name and found out that the default when changed was found under

HKEY_CURRENT_USER
Software\Microsoft\Windows NT\Current Version\Windows
`Device` value correspond to the default printer.

I did many changes and found the default printer name at the same place every single time.

When I think of it, it make sense. Since the default printer is not define globaly (like Windows 98) but by active user it is normal to find it under CURRENT_USER.

I will do some testing under Windows 2000 as soon as I can and let you know about my finding.

Can you to confirm if I`m right or not.

Regards[/u]
Gilbert Vaillancourt
turbolog@videotron.ca
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Badara Thiam » Fri Nov 17, 2006 9:25 am

Hi Gilbert,

Yesterday i seek in XP registry but not found, and today
you give me the right way ! 8)

I confirm this work under XP.

I shall put a new upgrade today in "Printer functions" thread.


Merci.

Regardes, :D
Badara Thiam
http://www.icim.fr
User avatar
Badara Thiam
 
Posts: 160
Joined: Tue Oct 18, 2005 10:21 am
Location: France

Postby Gilbert » Fri Nov 17, 2006 9:21 pm

Ho Badara,


I did more research & testing today. What I fiind out on XP worked well on 2000 but not on XP. Still will search for an answer and let you know later on.
Gilbert Vaillancourt
turbolog@videotron.ca
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Gilbert » Mon Nov 20, 2006 5:32 am

Hi Barada,

I did more searching, specialy in XP registers, and find out that there is two places were available printers can be found:

For two shared printers installed on a station running Windows 98:
HKEY_LOCAL_MACHINE\system\CurrentControlSet\COntrol\Print\Printers

and

For two shared printers installed on a station running Windows 2000:
HKEY_CURRENT_USER\Printers\Connections

Seems that shared printers from 98 technologie are stored elsewhere than for NT technologie. Is it possible for you to confirm my findings ?



Also discovered that under XP it is possible to retreive printers capabilities directly from the registers.

These capabilities are:

printBinNames Array of paper bins
printCollate Binary of collate type
printDuplexSupport Binary of type of duplex
printMaxResolutionSupported Binary of maximum resolution
printMediaSupported Array of paper sizes
printOrientationSupported Array of orientations

They can be found under:

For two shared printers installed on a station running Windows 98:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Print\Printers\<PRINTERNAME>\DsDriver

and

For two shared printers installed on a station running Windows 2000:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\<SERVERNAME>\Printers<PRINTERNAME>\DsDriver

Is it also possible for you to confirm these findings ?

In the later <SERVERNAME> can be anything depending on wich server we are attached to. Is it possible, from the register, to retreive the server to wich a station is attached to ?


I also would like Antonio to get invole in this thread. It would be most helpfull.

Regards,
Gilbert Vaillancourt
turbolog@videotron.ca
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Gilbert » Mon Nov 20, 2006 7:39 pm

Hi Badara,


I did more searching and found out that the printer capabilities available under 2000 and XP cannot be found anywhere in Windows 98.

Could you validate this ?

Regards
Gilbert Vaillancourt
turbolog@videotron.ca
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Badara Thiam » Tue Nov 21, 2006 8:25 am

Hi Gilbert,

Sorry, i was not here these days.

I answer you today.

Regards,
Badara Thiam
http://www.icim.fr
User avatar
Badara Thiam
 
Posts: 160
Joined: Tue Oct 18, 2005 10:21 am
Location: France

Postby Gilbert » Tue Nov 21, 2006 2:42 pm

Hi Barada,


Yesterday, I was talking to one of my friend that is very familliar with API calls. Unfortenatly he doesnt work with FiveWin but he says that all printers informations are available trought API Calls.

He says that trying to retreive this information from the register is a difficult task and he strongly suggested to forget the Windows register.

So, after talking to him, I downloaded API Guide and start investigating. I found out that all available printers under Windows 98, ME, 20, XP etc. is effectively retreivable from a few API Calls.

The only problem is that API Calls are made though DLL32 Class and I`m not familiar with it yet. I started a new thread on this subject, but have no reply yet.

I will try out some testing and let you know as I move along.

Regards,
Gilbert Vaillancourt
turbolog@videotron.ca
Gilbert
 
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Postby Badara Thiam » Tue Nov 21, 2006 5:50 pm

Gilbert,

Gilbert wrote:Hi Barada,

I did more searching, specialy in XP registers, and find out that there is two places were available printers can be found:


More than 2 places, but there is some place where :

1 - There is not the information needed
2 - The datas are not upgraded (or deleted )
when i delete the printer driver.


For two shared printers installed on a station running Windows 98:
HKEY_LOCAL_MACHINE\system\CurrentControlSet\COntrol\Print\Printers

and

For two shared printers installed on a station running Windows 2000:
HKEY_CURRENT_USER\Printers\Connections

Seems that shared printers from 98 technologie are stored elsewhere than for NT technologie. Is it possible for you to confirm my findings ?


Yes, but have you tested my last upgrade off WinGetPrn() and others ?
There is more way where this function search.

Also discovered that under XP it is possible to retreive printers capabilities directly from the registers.

These capabilities are:

printBinNames Array of paper bins
printCollate Binary of collate type
printDuplexSupport Binary of type of duplex
printMaxResolutionSupported Binary of maximum resolution
printMediaSupported Array of paper sizes
printOrientationSupported Array of orientations

They can be found under:

For two shared printers installed on a station running Windows 98:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Print\Printers\<PRINTERNAME>\DsDriver

and

For two shared printers installed on a station running Windows 2000:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\<SERVERNAME>\Printers<PRINTERNAME>\DsDriver

Is it also possible for you to confirm these findings ?



I have upgrade WinGetPrn() to retrieve with the key you give for 2000,
but for XP. The key for w98 is not complete for me. It stop to :

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion



In the later <SERVERNAME> can be anything depending on wich server we are attached to. Is it possible, from the register, to retreive the server to wich a station is attached to ?

This seem the case for the printers servers. I have put it in the upgrade,
in "Print system function" thread.

I also would like Antonio to get invole in this thread. It would be most helpfull.



Yes, he can perhaps help to translate binary data
into a clipper usable format. Or other, i don't know.
Badara Thiam
http://www.icim.fr
User avatar
Badara Thiam
 
Posts: 160
Joined: Tue Oct 18, 2005 10:21 am
Location: France

Postby Badara Thiam » Tue Nov 21, 2006 6:01 pm

Gilbert wrote:Hi Badara,


I did more searching and found out that the printer capabilities available under 2000 and XP cannot be found anywhere in Windows 98.

Could you validate this ?



I don't know exactly, because there is informations
in binary datas than i can't analyse.

For sample, i have created there is many months this function
for w98, and i have not finished because this line :

cDevMode := oReg:Get("Default DevMode", "")

can't work with binary datas. I forgot this work.

Code: Select all  Expand view  RUN
******************
FUNCTION WinDevMode(cNomImpr)
******************
* Retourne le contenu DevMode en allant le chercher dans le registre Windows
* (regedit.exe)

* Inutilisée pour le moment (conversion en données compréhensibles à faire
* pour le contenu récupéré )

LOCAL cDevMode := ""
LOCAL oReg := TReg32():New(HKEY_LOCAL_MACHINE,;
"System\CurrentControlSet\Control\Print\Printers" + STRTRAN(cNomImpr, "", ","))
IF oReg:nError = 0
  cDevMode := oReg:Get("Default DevMode", "")
ENDIF
oReg:Close()
oReg := NIL
RETURN cDevMode
Badara Thiam
http://www.icim.fr
User avatar
Badara Thiam
 
Posts: 160
Joined: Tue Oct 18, 2005 10:21 am
Location: France


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 20 guests