473,657 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The DOS window in a Console Application

I have written a Console Application then created a shortcut to it on my
desktop. I was able to minimize the DOS window when I click my shortcut so I
dont see anymore the DOS window

But, using Task Manager to run the shortcut, I am not able to get rid of
(minimize) the DOS window.

Is there somebody that is aware of this problem ?

My application is an agenda, so Task Manager runs it every 15 minutes, to
check for appointments. It would be nice not to see that DOS window every
time the application is running.

Marcel


--
Super Basic programmer under DOS since 1983. Absolutely dummy VB.NET
programmer under Windows !
Nov 8 '06 #1
3 2051

Marcel Saucier wrote:
I have written a Console Application then created a shortcut to it on my
desktop. I was able to minimize the DOS window when I click my shortcut so I
dont see anymore the DOS window

But, using Task Manager to run the shortcut, I am not able to get rid of
(minimize) the DOS window.

Is there somebody that is aware of this problem ?

My application is an agenda, so Task Manager runs it every 15 minutes, to
check for appointments. It would be nice not to see that DOS window every
time the application is running.
Isn't that what .pif files are for?

B.

Nov 8 '06 #2
Do you want the window to appear minimized or not appear at all. In either
case, look up ShowWindow in the Windows API.

Mike Ober.

"Marcel Saucier" <Ma***********@ discussions.mic rosoft.comwrote in message
news:91******** *************** ***********@mic rosoft.com...
I have written a Console Application then created a shortcut to it on my
desktop. I was able to minimize the DOS window when I click my shortcut so
I
dont see anymore the DOS window

But, using Task Manager to run the shortcut, I am not able to get rid of
(minimize) the DOS window.

Is there somebody that is aware of this problem ?

My application is an agenda, so Task Manager runs it every 15 minutes, to
check for appointments. It would be nice not to see that DOS window every
time the application is running.

Marcel


--
Super Basic programmer under DOS since 1983. Absolutely dummy VB.NET
programmer under Windows !


Nov 9 '06 #3
Hi Michael,

I want the DOS window not to appear at all (when my console application (the
shortcut) is called from task manager). My application only send a MSGBOX
when needed.

Could you give me more information about ShowWindow in Windows API ? I have
no idea what it is. I am very new in VB under Windows. And I like simple
things...

Below is a complete listing of the application.

--
Super Basic programmer under DOS since 1983. Absolutely dummy VB.NET
programmer under Windows !
"Michael D. Ober" wrote:
Do you want the window to appear minimized or not appear at all. In either
case, look up ShowWindow in the Windows API.

Mike Ober.

"Marcel Saucier" <Ma***********@ discussions.mic rosoft.comwrote in message
news:91******** *************** ***********@mic rosoft.com...
I have written a Console Application then created a shortcut to it on my
desktop. I was able to minimize the DOS window when I click my shortcut so
I
dont see anymore the DOS window

But, using Task Manager to run the shortcut, I am not able to get rid of
(minimize) the DOS window.

Is there somebody that is aware of this problem ?

My application is an agenda, so Task Manager runs it every 15 minutes, to
check for appointments. It would be nice not to see that DOS window every
time the application is running.

Marcel


--
Super Basic programmer under DOS since 1983. Absolutely dummy VB.NET
programmer under Windows !

Imports System.Globaliz ation
Module Module1

Dim I As Integer
Dim J As Integer
Dim K As Integer
Dim DAY_INT As Integer
Dim TIME_INT As Integer

Dim CD As String
Dim LAST_RUN_DATE As String
Dim CT As String
Dim LAST_RUN_TIME As String
Dim LBL(15) As String
Dim MESSAGE As String

Dim PARM_CONTROL_RE C As String
Dim PARM_LANGUAGE As String
Dim PARM_DAYS_SHOWN As String = "30"
Dim PARM_TAB_DAYS As String = "28-21-14-07-01-00"
Dim PARM_TAB_TIME As String = "40"
Dim PARM_USERS As String = "MS-DS"
Dim ET(20) As String
Dim FT(20) As String
Dim ST(20) As String

Dim CALL_MAIN As Boolean = False
Dim WEEK_DAY As Boolean = False

Dim DATE_CURR As Date
Dim DATE_REC As Date

Dim TIME_CURR As DateTime
Dim TIME_REC As DateTime

Dim CULTURE_INFO As CultureInfo = CultureInfo.Cur rentUICulture '
"en-US"...

Sub Main()

If Mid(CULTURE_INF O.ToString, 1, 2) = "en" Then PARM_LANGUAGE = "E"
Else PARM_LANGUAGE = "F"

CD = Mid(DateAndTime .DateString, 7, 4) & "-" &
Mid(DateAndTime .DateString, 1, 2) & "-" & Mid(DateAndTime .DateString, 4, 2)
CT = Mid(DateAndTime .TimeString, 1, 5)

DATE_CURR = CD
TIME_CURR = CT

If Mid(CT, 4, 2) = "00" Then Beep()

Call R1400_READ_RUN_ CONTROL()

Call R1000_LANGUAGE_ TEXT()

Call R1150_READ_FILE ()

DAY_INT = DateDiff(DateIn terval.Day, DATE_CURR, #12/31/2007#) : Call
R1100_CHECK_FOR _WEEK_DAYS()

For I = 1 To 15
If LBL(I) = "" Then Exit For
DATE_REC = Mid(LBL(I), 1, 10)
TIME_REC = Mid(LBL(I), 14, 5)
DAY_INT = DateDiff(DateIn terval.Day, DATE_CURR, DATE_REC)
TIME_INT = DateDiff(DateIn terval.Minute, TIME_CURR, TIME_REC)
If DATE_REC = "2007-12-31" And CT = TIME_REC And WEEK_DAY = True
Then DAY_INT = -100 : Call R1200_MESSAGE() : Exit For
For J = 1 To Len(PARM_TAB_DA YS) Step 3
If DAY_INT = Val(Mid(PARM_TA B_DAYS, J, 2)) Then MESSAGE =
ST(2) & RTrim(Mid(PARM_ TAB_DAYS, J, 2)) & ST(3) : Call R1200_MESSAGE() : Exit
For
Next
If DAY_INT < 0 And DAY_INT -100 Then Call R1200_MESSAGE()
Next

Call R1500_WRITE_NOT _RUNNING()

If CALL_MAIN = True Then If Dir("C:\REMIND_ M.EXE") = "" Then
Shell("C:\Docum ents and Settings\MARCEL SAUCIER\My Documents\Visua l Studio
2005\Projects\R EMIND_M\REMIND_ M\bin\Release\R EMIND_M.exe",
AppWinStyle.Nor malFocus) Else Shell("C:\REMIN D_M.exe",
AppWinStyle.Nor malFocus)
End Sub
Public Sub R1000_LANGUAGE_ TEXT()

ET(1) = "ENGLISH"
FT(1) = "FRANÇAIS"

ET(2) = "In "
FT(2) = "Dans "

ET(3) = " DAYS, on the "
FT(3) = " JOURS, le "

ET(4) = "You have MISSED an appointment, on the "
FT(4) = "Vous avez MANQUÉ un rendez-vous, le "

ET(5) = "MORE THAN 15 ENTRIES IN FILE..."
FT(5) = "PLUS DE 15 ENTRÉES AU FICHIER..."

ET(6) = "YOU HAVE AN APPOINTMENT TODAY !!!, on the "
FT(6) = "VOUS AVEZ UN RENDEZ-VOUS AUJOURD'HUI !!!, le "

ET(7) = "You have an appointment TOMORROW, on the "
FT(7) = "Vous avez un rendez-vous DEMAIN, le "

If PARM_LANGUAGE = "E" Then For I = 1 To 20 : ST(I) = ET(I) : Next I
Else For I = 1 To 20 : ST(I) = FT(I) : Next I

End Sub
Public Sub R1100_CHECK_FOR _WEEK_DAYS()
For J = DAY_INT To -7 Step -7
If J <= 7 And J >= 3 Then WEEK_DAY = True : Exit Sub
Next
End Sub

Public Sub R1150_READ_FILE ()
If Dir("C:\REMINDE R.TXT") = "" Then Exit Sub
FileOpen(1, "C:\REMINDER.TX T", OpenMode.Input)
I = 0
While Not EOF(1)
I = I + 1
If I 15 Then MsgBox(ST(5)) : Exit While
LBL(I) = LineInput(1)
End While
FileClose(1)
End Sub
Public Sub R1200_MESSAGE()

If DAY_INT 0 And CD = LAST_RUN_DATE Then Exit Sub
If DAY_INT = 0 And CD = LAST_RUN_DATE Then If TIME_INT >
Val(PARM_TAB_TI ME) Then Exit Sub

If DAY_INT = 1 Then MESSAGE = ST(7)
If DAY_INT = 0 And TIME_INT >= 0 Then MESSAGE = ST(6)
If (DAY_INT = 0 And TIME_INT < 0) Or (DAY_INT < 0 And DAY_INT >
-100) Then MESSAGE = ST(4)

If (DAY_INT = 0 And TIME_INT <= 0) Or (DAY_INT < 0 And DAY_INT >
-100) Then CALL_MAIN = True

If DAY_INT = -100 Then MsgBox(Mid(LBL( I), 12)) Else MsgBox(MESSAGE &
LBL(I))

End Sub
Public Sub R1400_READ_RUN_ CONTROL()
If Dir("C:\REMIND_ P.TXT") = "" Then Call R1600_WRITE_RUN NING() :
Exit Sub

FileOpen(1, "C:\REMIND_P.TX T", OpenMode.Input)
PARM_CONTROL_RE C = LineInput(1)
PARM_LANGUAGE = LineInput(1)
PARM_DAYS_SHOWN = LineInput(1)
PARM_TAB_DAYS = LineInput(1)
PARM_TAB_TIME = LineInput(1)
PARM_USERS = LineInput(1)
FileClose(1)

LAST_RUN_DATE = Mid(PARM_CONTRO L_REC, 5, 10)
LAST_RUN_TIME = Mid(PARM_CONTRO L_REC, 18, 5)
If Mid(PARM_CONTRO L_REC, 1, 1) = "0" Then Call R1600_WRITE_RUN NING()
Else End
End Sub
Public Sub R1500_WRITE_NOT _RUNNING()
PARM_CONTROL_RE C = "0" & " * " & CD & " * " & CT
Call R1700_WRITE_FIL E()
End Sub
Public Sub R1600_WRITE_RUN NING()
PARM_CONTROL_RE C = "1" & " * " & CD & " * " & CT
Call R1700_WRITE_FIL E()
End Sub
Public Sub R1700_WRITE_FIL E()
FileOpen(1, "C:\REMIND_P.TX T", OpenMode.Output )
Print(1, PARM_CONTROL_RE C & Chr(13) & Chr(10))
Print(1, PARM_LANGUAGE & Chr(13) & Chr(10))
Print(1, PARM_DAYS_SHOWN & Chr(13) & Chr(10))
Print(1, PARM_TAB_DAYS & Chr(13) & Chr(10))
Print(1, PARM_TAB_TIME & Chr(13) & Chr(10))
Print(1, PARM_USERS & Chr(13) & Chr(10))
FileClose(1)
End Sub
End Module

Nov 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4458
by: Jason Callas | last post by:
I am trying to figure out how to create a console window but cannot figure out how to do this. I know it can be done since the C# and VB console template projects do this but I see no code on how this is done. The only thing I can think of is that there is hidden code to spawn cmd.exe? Then they somehow direct console.read and console.write calls to the spawned process. Any thoughts (and some sample code) would be greatly appreciated.
1
3698
by: gemel | last post by:
I am debugging code that writes to the console window, I select an appropriate line and the select 'Run to Cursor'. The console output does appear and then the window closes. How can I keep this window open without having to put Console.ReadLine() statements in my code? Regards John L
8
11525
by: Mészáros Tamás | last post by:
Hi all, how can I set an app's main window to visible from an other application? My problem is, that I know only the handle of the other app's main process, because the application's main window is set to hidden, so it doesn't have a mainwindowHandle, so I can't send a message to it. Any idea? Thank's in advance,
7
12357
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
10
6331
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden so that the window for the Console application is not visible. However, when using some of the 'advanced' properties of the StartInfo object, like Username, Password and Domain, the WindowsStyle property of the StartInfo object is ignored....
12
6526
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow combination to hide the console window at launch time. The application (for legacy reasons) hangs around by waiting on an old- fashioned Console.ReadLine() statement.
2
4774
by: ssg31415926 | last post by:
Is it possible to create a console app that doesn't display a window? I want to create an app which runs before the main app and starts it in another process and I don't want the console box to appear and disappear as it does at present.
6
3456
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am using the following command to output my results to the Output window (for testing things out). Console.WriteLine ("Output") I'd like to clear the Output window of any previous output. I tried Console.Clear but, this results in an error.
5
10767
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in server. Now, every console program instance will open a command mode window and they occupy the whole screen. I want to minimize all of them and maximize it if neccessary by manual. Is it possible and how to do it? I'm using VB.NET 2005. ...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.