473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 2031

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.microsoft.comwrote in message
news:91**********************************@microsof t.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.microsoft.comwrote in message
news:91**********************************@microsof t.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.Globalization
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_REC 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.CurrentUICulture '
"en-US"...

Sub Main()

If Mid(CULTURE_INFO.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(DateInterval.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(DateInterval.Day, DATE_CURR, DATE_REC)
TIME_INT = DateDiff(DateInterval.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_DAYS) Step 3
If DAY_INT = Val(Mid(PARM_TAB_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:\Documents and Settings\MARCEL SAUCIER\My Documents\Visual Studio
2005\Projects\REMIND_M\REMIND_M\bin\Release\REMIND _M.exe",
AppWinStyle.NormalFocus) Else Shell("C:\REMIND_M.exe",
AppWinStyle.NormalFocus)
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:\REMINDER.TXT") = "" Then Exit Sub
FileOpen(1, "C:\REMINDER.TXT", 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_TIME) 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_RUNNING() :
Exit Sub

FileOpen(1, "C:\REMIND_P.TXT", OpenMode.Input)
PARM_CONTROL_REC = 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_CONTROL_REC, 5, 10)
LAST_RUN_TIME = Mid(PARM_CONTROL_REC, 18, 5)
If Mid(PARM_CONTROL_REC, 1, 1) = "0" Then Call R1600_WRITE_RUNNING()
Else End
End Sub
Public Sub R1500_WRITE_NOT_RUNNING()
PARM_CONTROL_REC = "0" & " * " & CD & " * " & CT
Call R1700_WRITE_FILE()
End Sub
Public Sub R1600_WRITE_RUNNING()
PARM_CONTROL_REC = "1" & " * " & CD & " * " & CT
Call R1700_WRITE_FILE()
End Sub
Public Sub R1700_WRITE_FILE()
FileOpen(1, "C:\REMIND_P.TXT", OpenMode.Output)
Print(1, PARM_CONTROL_REC & 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
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...
1
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...
8
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...
7
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
10
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...
12
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...
2
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...
6
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.